I have yet to find a decent solution for my scenario. Basically, I have an ASP.NET MVC website that has a fair bit of database access for creating views (2-3 queries for each view), and I would like to use caching to improve performance.
The problem is that the views contain data that can change irregularly, for example, it can be the same for 2 days or the data can change several times per hour.
Queries are fairly simple (select ... where), rather than huge joins, each of which returns an average of 20-30 rows of data (about 10 columns).
Requests are quite simple at the current stages, but over time, the owner will add more data and the number of visitors will increase. They are large at the moment, and I would look at caching, since the traffic will come mainly from Google AdWords, etc., and the quick loading pages will be useful (apparently).
The site will be hosted in a Microsoft SQL Server 2005 database (but may require upgrading to 2008).
I also:
Set the caching at the minimum time when the item does not change (for example, the cache in 3 minutes) and tell the owner that any changes will appear before 3 minutes?
Find a way to force the cache to clear and process the changes (for example, if the owner adds an item in the administration panel, it clears the corresponding caches)
Forget about caching together
Or is there an option that will fit this scenario?
c # caching asp.net-mvc
Phil
source share