pdfjs_viewer-rails icon indicating copy to clipboard operation
pdfjs_viewer-rails copied to clipboard

pdf.worker.js is not cached by CDN

Open abhishek77in opened this issue 4 years ago • 2 comments

I have configured CDN for my app, but pdf.worker.js and other static files are still hitting the rails server. How do I avoid this?

abhishek77in avatar May 27 '20 03:05 abhishek77in

PDF js files are heavy and using CDN would improve the performance.

https://github.com/mozilla/pdf.js#including-via-a-cdn

mozilla_pdf_js__PDF_Reader_in_JavaScript

abhishek77in avatar Aug 11 '20 03:08 abhishek77in

Hi, upon further investigations I can see assets on which stylesheet_link_tag eg is used are setting the cache-control headers correctly but assets which are linked directly do not set any cache-control headers eg.

This is an issue in production as viewer loads several different static files (around 35 files) which have to be downloaded from the origin server instead of being downloaded via the CDN.

abhishek77in avatar Sep 29 '20 15:09 abhishek77in