Bugzilla – Attachment 70830 Details for
Bug 12904
Force browser to load new JavaScript and CSS files after upgrade
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12904: Force browser to load new javascript files after upgrade
Bug-12904-Force-browser-to-load-new-javascript-fil.patch (text/plain), 5.91 KB, created by
Jonathan Druart
on 2018-01-23 13:30:24 UTC
(
hide
)
Description:
Bug 12904: Force browser to load new javascript files after upgrade
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-01-23 13:30:24 UTC
Size:
5.91 KB
patch
obsolete
>From c8ceacb4c35bc5a3ec3024d2f5c610da0a5bee2b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 15 Aug 2016 16:01:37 +0000 >Subject: [PATCH] Bug 12904: Force browser to load new javascript files after > upgrade > >A common issue with Koha seems to be that the web browsers continue to >use cached js files after an upgrade. If we append the version as a >parameter, we can force the browser to update the javascript files. > >1) Apply this patch on a new branch based on master. >2) In a separate branch check out a previous version of Koha and go > through the installation process on an empty database. >3) After logging into Koha, turn on Firebug's Net panel (or Chrome's > Network panel) and turn on the filter for JavaScript files. >4) Clear the browser cache and navigate to a page, for instance > Circulation. In Firebug the Net panel should show a status of "200 > OK" for all files, indicating that the file was downloaded, not > loaded from the cache. In Chrome the "size" column will show a file > size if the file was downloaded. >5) Navigate to another page and confirm that scripts are being loaded > from the cache: Scripts like jquery.js and jquery-ui.js which are > loaded on every page should have a status in the Firebug Net panel of > "304 Not Modified." In Chrome the "size" columns should show "from > cache." >6) Check out the branch you created for testing this patch. >7) In order to preserve the state of your browser cache for accurate > testing, open a different browser from the one you were previously > testing with, load Koha, and run through the database update. >8) Return to your original testing browser and navigate to another Koha > page. Firebug's Net panel should show that script files are now being > downloaded with a "koha_version" query string. These files should > have a status of "200 OK" indicating that they are being downloaded, > not loaded from the cache. >9) Navigate to another page and conifrm that the new versions of the > scripts are being loaded from the cache. > >To confirm that all affected JavaScripts links are working correctly, >test these pages by checking the Firebug Net panel for errors: > >- Administration -> Currencies and exchange rates > (jquery.dataTables.colvis.js) >- Tools -> Stage MARC records for import (ajaxfileupload.js) or another > page which performs a file upload. >- Catalog -> Detail page -> MARC Preview (greybox JS) >- Help -> Any help page >- Any page which loads DataTables (Circulation in the staff client, for > instance, and a title's detail page in the OPAC) >- Bonus points if you check the various conditional JS includes > controlled by the many OPAC feature preferences > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > debian/templates/apache-shared-intranet.conf | 2 ++ > debian/templates/apache-shared-opac.conf | 2 ++ > debian/templates/apache-shared.conf | 4 ++-- > etc/koha-httpd.conf | 5 ++++- > 4 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf >index 211794262e..429a8ab781 100644 >--- a/debian/templates/apache-shared-intranet.conf >+++ b/debian/templates/apache-shared-intranet.conf >@@ -17,6 +17,8 @@ RewriteRule (.+) $1?%1%2 [N,R,NE] > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >+RewriteRule ^(.*)_(.*).js$ $1.js [R=301,N,L] >+RewriteRule ^(.*)_(.*).css$ $1.css [R=301,N,L] > > Alias "/api" "/usr/share/koha/api" > <Directory "/usr/share/koha/api"> >diff --git a/debian/templates/apache-shared-opac.conf b/debian/templates/apache-shared-opac.conf >index 0e18bc2b87..ca2f7c3f86 100644 >--- a/debian/templates/apache-shared-opac.conf >+++ b/debian/templates/apache-shared-opac.conf >@@ -17,6 +17,8 @@ RewriteRule (.+) $1?%1%2 [N,R,NE] > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >+RewriteRule ^(.*)_(.*).js$ $1.js [R=301,N,L] >+RewriteRule ^(.*)_(.*).css$ $1.css [R=301,N,L] > > <IfVersion >= 2.4> > AliasMatch "^/sitemap(.*)" "/var/lib/koha/${instance}/sitemap/sitemap$1" >diff --git a/debian/templates/apache-shared.conf b/debian/templates/apache-shared.conf >index b923578e0b..f29c7accb8 100644 >--- a/debian/templates/apache-shared.conf >+++ b/debian/templates/apache-shared.conf >@@ -58,8 +58,8 @@ SetEnv PERL5LIB "/usr/share/koha/lib" > > <IfModule mod_expires.c> > ExpiresActive on >- ExpiresByType text/css "access plus 12 hours" >- ExpiresByType application/javascript "access plus 12 hours" >+ ExpiresByType text/css "access plus 60 days" >+ ExpiresByType application/javascript "access plus 60 days" > ExpiresByType image/png "access plus 12 hours" > ExpiresByType image/gif "access plus 12 hours" > </IfModule> >diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf >index c3b55a41b6..4f1eb741a5 100644 >--- a/etc/koha-httpd.conf >+++ b/etc/koha-httpd.conf >@@ -111,6 +111,8 @@ > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >+ RewriteRule ^(.*)_(.*).js$ $1.js [R=301,N,L] >+ RewriteRule ^(.*)_(.*).css$ $1.css [R=301,N,L] > > # REST API configuration > Alias "/api" "__API_CGI_DIR__" >@@ -228,7 +230,8 @@ > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >- >+ RewriteRule ^(.*)_(.*).js$ $1.js [R=301,N,L] >+ RewriteRule ^(.*)_(.*).css$ $1.css [R=301,N,L] > > # REST API configuration > Alias "/api" "__API_CGI_DIR__" >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12904
:
31514
|
31547
|
33287
|
33288
|
33295
|
33296
|
33297
|
33315
|
33317
|
33318
|
33319
|
33320
|
33321
|
33323
|
33324
|
33325
|
33326
|
33327
|
33328
|
48735
|
48736
|
48737
|
48738
|
48739
|
48740
|
48741
|
48742
|
49572
|
54484
|
54485
|
54488
|
54489
|
58378
|
58379
|
58392
|
58393
|
58394
|
58395
|
60826
|
60827
|
60830
|
60831
|
63692
|
63693
|
63694
|
63695
|
63696
|
70830
|
70831
|
70832
|
70833
|
70834
|
70835
|
71250
|
71251
|
71252
|
71253
|
71254
|
71255
|
71822