[Koha-bugs] [Bug 12904] Force browser to load new javascript files after upgrade

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed May 24 16:07:10 CEST 2017


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

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #60826|0                           |1
        is obsolete|                            |
  Attachment #60827|0                           |1
        is obsolete|                            |
  Attachment #60830|0                           |1
        is obsolete|                            |
  Attachment #60831|0                           |1
        is obsolete|                            |

--- Comment #73 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 63692
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63692&action=edit
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 at bywatersolutions.com>
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti at jns.fi>

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

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


More information about the Koha-bugs mailing list