-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add Cache-Control support for Parse.Files / FilesRouter #1857
Comments
This is a great idea. @skinp has done most of our files related code, hopefully he can point out where this might be added. |
Any update on this? I implemented CloudFront support using my AWS S3 storage. But running the PageSpeed Insights from Google suggests that my files don't have Cache-Control: Thanks! |
Not yet, but your could take over @KBog . Also you coud implement it into the https://github.com/parse-server-modules/parse-server-s3-adapter as a global cache control for all s3 uploaded files |
Here's my attempt to add the global cache control as you suggested: I made the change locally at first (localhost), and was able to see (in Chrome debugger) the "Cache-Control" being added to newly saved Parse.Files. Pardon any newbie mistakes, as I'm still a beginner when it comes to web/server dev :) |
let's see how it goes! |
Has cache control been added to the current S3 adapter? |
Yes, it's been out for a while. Tested it and working in our production app. |
Should probably close this issue to avoid confusion. |
I believe the cache-control only works if you are accessing the files directly through S3 ( |
Is the cache control available for non S3 file adapters? |
Looks like this has been added to the S3 adapter but was never closed out. Taking care of it now, let us know if we're missing anything and this needs be reopened! |
I just read this thread looking for an answer. If I'm right, the initial question has never been answered and this is still not an option for the standard FilesRouter. Is there any option to set the Cache-Control header with the standard GridFS adapter ? |
Currently, the
FilesRouter
sets no response headers other that theContent-Type
of the file being requested. It would be great if we could somehow configure also sending aCache-Control
header for file requests.One idea would be for each
Parse.File
to specify its cache mechanism (by default it could have caching disabled). Another idea is to have a "global" caching mechanism that could work as a default.I would gladly help submitting a PR if someone could point me in the right direction :)
The text was updated successfully, but these errors were encountered: