I have a ASP.NET MVC 3.0 project with a MySQL database that going to need caching on to get faster to load for users.
What is your best tip on how to do caching on a ASP.NET MVC project?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you want server-side caching (e.g caching “data”), you should look into .NET 4.0’s new ObjectCache.
If you want output cache, you should decorate your action methods with said attribute, much like with Web Forms.
E.g:
You should use one or both, depending on the situation at hand.
E.g “weighty” database calls should be cached on the web server (e.g “data caching”).
And HTML that doesn’t change often should be cached on the client with output cache.