Ticket (Solved)

How do I bust javascript caching?

I have problems when updating my javascript files, often end users browsers keep the older version cached. I have seen lots of ideas about time stamping, etc. How can I accomplish this in orchard.

Re: How do I bust javascript caching?

Maybe append the script URL with a version number as a querystring?

Sunday, February 22, 2015 11:25:36 PM bysfmskywalker

Re: How do I bust javascript caching?

I saw some discussions about time stamping, and was hoping someone knew of an orchard implementation of this, I will look into your suggestion sipke,

Monday, February 23, 2015 4:11:07 PM byRob Allred

Re: How do I bust javascript caching?

Do you have a link to that discussion?

Monday, February 23, 2015 4:12:45 PM bysfmskywalker

Re: How do I bust javascript caching?

this was one of them http://orchard.codeplex.com/discussions/303669 it was for css but I think it applys to javascript files too

Monday, February 23, 2015 4:21:00 PM byRob Allred

Re: How do I bust javascript caching?

I see. I like the suggestion of having a .WithTimeStamp method on the resource, which would then use the .Version information of that resource and append it to the querystring. This would require Orchard core changes, so you may want to open an issue for that. Until that is implemented, I would simply append a ?v=xxx querystring yourself, and increase xxx every time you release a new version of your script.

Monday, February 23, 2015 4:46:25 PM bysfmskywalker

Post a reply

You need to be signed in to post a reply.

Sign In