1

I have a web app written in ASP.NET MVC 3.0. There are some largish scripts (jQuery, jQuery UI) which I want to ensure are cached for best performance. In the Chrome Developer Tools Network tab the scripts always take around 1.5 seconds to be received when a page is loaded. I would assume if they are cached this would be near instant.

Is there any way to ensure javascript is being cached and how to tell if it is or isn't?

1 Answer 1

2

For JQuery in particular it is better to use someone elses CDN - you will not have to stream this content from your server AND caching is properly done by someone else. See http://docs.jquery.com/Downloading_jQuery for recommended CDNs.

For files that you have to host yourself make sure you set correct caching headers.

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

3 Comments

Yeah, I might look at this and see how much difference it makes.
You can verify this using a tool like YSlow. Amongst other things it will tell you what resources are cached.
Found some useful info here as well blog.itopia.de/windowsazure-web-config-settings/309

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.