Monday, December 5, 2011

.js caching

We had a conversation today about the pain of .js files being cached and what to do about it. One thing that could be done would be to have a random number bubble up from C# into a Razor view to follow a call to a .js file like so:

whatever.js?@ViewBag.MyRandomNumber

...but of course, the problem with this is that the .js file is never cached which leads to another set of pain points. Perhaps it's better to use the current date, specific only to the day. We could start versioning our .js files but that could get painful too.

No comments:

Post a Comment