5

I have a site that serves mostly static data from a database, so I'd like to have the maximum caching possible. The database is very weak and slow.

I am using shared hosting, so am limited to the [OutputCache] on the Controller and web.config

Is there a "max" strategy?

Ian

1
  • There's nothing wrong with setting the cache duration to 60 minutes. At most you'll have 24 calls to the database per day, which is nothing. Commented Nov 7, 2013 at 21:50

1 Answer 1

12

You can try going for the below option, it should give you 2147483647 seconds (24855 days) max duration for int32:

[OutputCache(Duration = int.MaxValue)]

Please note however that it is not guaranteed that your cache will be preserved exactly for the amount of time that you specify; it depends on memory utilization - if memory becomes too low, cache will be removing data automatically.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.