[Koha-bugs] [Bug 12904] Force browser to load new JavaScript and CSS files after upgrade

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 20 15:05:31 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12904

--- Comment #115 from Kyle M Hall <kyle at bywatersolutions.com> ---
AFAIK, the reason the former is better then the latter is fairly simple. With
the latter ( that is, /my/file.js?version=[%  KOHA_VERSION %] ), the file will
*never* be cached. It will always be fetched on each page load. Since we would
be passing a GET parameter, a modern web browser would assume the contents of
the URL may vary based on the parameter, and will assume it shouldn't cache the
file.

Kyle

(In reply to Marcel de Rooy from comment #114)
> (In reply to Jonathan Druart from comment #113)
> > Could anyone explain (again) why we choose to append the version to the
> > filename and not in parameter?
> > 
> > So basically why:
> >   /my/file_[% KOHA_VERSION %].js
> > and not:
> >   /my/file.js?version=[%  KOHA_VERSION %]
> > 
> > Kyle and Martin talked about the two approaches earlier in comments (from
> > comment 4) but I do not understand. Please clarify.
> > 
> > It could avoid the rewrite rules.
> 
> From one of the linked sources:
> ===
> But which is better: mylogo.1.2.gif or mylogo.gif?v=1.2? To gain the benefit
> of caching by popular proxies, avoid revving with a querystring and instead
> rev the filename itself.
> ===
> I am not sure if passing a version as parameter in a script URL would be
> good practice. It seems quite uncommon, but I may be wrong?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list