Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf.worker.js is not cached by CDN #63

Open
abhishek77in opened this issue May 27, 2020 · 2 comments
Open

pdf.worker.js is not cached by CDN #63

abhishek77in opened this issue May 27, 2020 · 2 comments

Comments

@abhishek77in
Copy link

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 abhishek77in changed the title pdf.worker.js is cached by CDN pdf.worker.js is not cached by CDN May 27, 2020
@abhishek77in
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant