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 374561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:25:02+00:00 2026-05-12T14:25:02+00:00

I would like to know if there is a way to have the .NET

  • 0

I would like to know if there is a way to have the .NET cache stored in a database table or file, rather than the in-memory cache, but also use the CacheDependency infrastructure. I think the Enterprise Library may be able to do this but I would prefer something simpler if possible.

To explain, I want the cached data to be put in an SQL table or into a file on disk, rather than in-memory. I then want to specify a CacheDependency, which could be an SqlCacheDependency, or a CacheDependency on a file or an AggregateCacheDependency.

The reason is, I do intensive calculations based on xml documents (that change once a day or so). The results of these calculations I cache in memory. However if the website is reset, the cache is lost. It would be nice to have a backup cache in the database.

  • 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-12T14:25:03+00:00Added an answer on May 12, 2026 at 2:25 pm

    Use SqlCacheDependency. You’ll need to manually manage the target data yourself, but you can have a dependency in the cache which is automatically invalidated when the target table changes.

    EDIT:

    Yes, you can use the Caching Block in Enterprise Library to have a cache provider that stores items in a database using the Data Access Block, which is an alternative to the ASP.NET. That’s likely to be the best solution, despite the higher learning curve.

    I think SqlCacheDependency is simpler because you use the ASP.NET cache to store a local memory version first for faster processing, falling back to the database layer when the local layer does not have the item available. Here’s an example of what I mean:

    • Your web application calls GetXmlDocument(string key) to get something to work with

    • The method checks the ASP.NET cache first for the item – if the item exists, great, you return that

    • If the item doesn’t exist, then you check the database for the existence of the item – if the item exists, you re-populate the local cache item with a SqlCacheDependency on the database table, and return the XML data

    • If the item doesn’t exist in the database either, you retrieve the XML data from wherever the primary source is, re-populate the database, re-populate the local cache item with SqlCacheDependency on the table, and return the XML data

    This gives you a self-managing two-tiered cache.

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

Sidebar

Related Questions

I would like to know if there is a way in Android to have
I would like to know if there is a way to integrate YAF.NET to
I'm new to PowerBuilder 12, and would like to know is there any way
I would like to know if there's a way in java to find out
I would like to know if there is a way to execute polygons queries
I would like to know if there is any way to find the actual
I would like to know if there is a way to keep the session
I would like to know if there is any way I can apply 100%
I would like to know if there is any way to return an char
I would like to know if there is a way to take create a

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.