Closed (fixed)
Project:
PDF
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Nov 2016 at 21:17 UTC
Updated:
18 Oct 2017 at 08:45 UTC
Jump to comment: Most recent
pdf.worker.js bypasses JS aggregation - it is loaded directly via URL: $js = "PDFJS.workerSrc = '$worker_loader';";
One of the side effects of this is that the old version of pdf.worker.js will be cached by CDNs, browsers, etc. if/when pdf.js is upgraded.
This typically results in fatal errors in pdf.js
Comments
Comment #2
shenzhuxi commentedHow does your Drupal refresh the cache of the aggregated JavaScript files on CDNs?
Comment #3
mfbThe way Drupal's aggregated JS works is that there is a new URL when it's regenerated. So, while the old JS may still be cached by the CDN, it's not actually used by the pages because there is a new filename. (Likewise, non-aggregated JS has a URL parameter appended by Drupal core.)
If the JS could be loaded via drupal_add_js() then everything would just work.
Comment #4
mfbAn alternative would be to append
"?v={$library['version']}"onto the URL - this way the JS would be cached under its version number, which would be updated when a new version is installed on the site.Comment #5
shenzhuxi commentedI put in the 7.x-1.x.