Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6573591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:09:11+00:00 2026-05-25T15:09:11+00:00

I am really confused to use caching. In ASP.NET Cache the cache object is

  • 0

I am really confused to use caching. In ASP.NET Cache the cache object is global so as I understand we can reach it everywhere. But when I looked at the caching application block how can I use a cache that I created on the application_start phase. What is the strategy to use a cache that I created on application_start ?

Thanks in advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:09:12+00:00Added an answer on May 25, 2026 at 3:09 pm

    once you have created the proper configuration snippet for your caching block and added to the web.config of the ASP.NET application, you can add items to the cache in the same way from anywhere in the asp.net application. Similarly, from a business or service layer which shares the same configuration snippet in its app.config or web.config you should be able to retrieve items from the cache.

    This is well explained here: Exploring Caching : Using Caching Application Enterprise Library 4.1

    so just try to create and use the ICacheManager, for example in this way:

    //Create Instance of CacheManager 
    ICacheManager objCacheManager = CacheFactory.GetCacheManager();    
    
    //Add a new CacheItem to Cache
    objCacheManager.Add("YourKey", yourObject);
    

    then from another project or web service running on that IIS but as another application, if the web.config contains the same snippet to configure caching, use this:

    //Create Instance of CacheManager 
    ICacheManager objCacheManager = CacheFactory.GetCacheManager();
    
    // Check If Key is in Cache Collection
    if(objCacheManager.Contains("YourKey"))
    {
      var myObject = objCacheManager.GetData("YourKey");
    }
    

    you should in fact imagine this to be down at lower level in the application architecture, if you are loading data from the database via Business Logic, I imagine that piece of BL will retrieve from database and add to the cache then in next query will check if it exists in the cache and if not will load again from database.

    For an example of configuration snippet check the link I mentioned above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am really confused now on how and which method to use to return
I am really confused about object relationships! I have two classes Person and Address.
I'm really confused about the visitor pattern and its uses. I can't really seem
I am really confused over what to use. Options I see are awt, Swing
I am really confused to choose either ModelState.IsValid or TryUpdateModel to use in my
I'm really confused - but really it's pretty wierd because I know two programming
I'm really confused. I'm trying to use some of the very simple Facebook plugins
I am really confused about when to use WCF and when to use ADO
I am really confused with select boxes in ROR. How can I generate a
I have to use a fancy font in a project but I'd really like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.