-
-
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
Possibility to set Cache-Control for files served by the standard FilesRouter #6427
Comments
you won't need this if you are using NGINX or Apache, nodejs is not ideal for caching and serving files |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any update on this? |
@neiroc not that I know of at least :/ |
Reopening issue due to continued discussion. Is anyone interested in tackling this in a PR? |
Hi @mtrezza I'd like to help but I'm not too sure how... I would do as @zhxiaogg did in this PR #4348. He basically added the 'Cache-Control', 'public, max-age=86400' header to the response but i don't think it's enough. Even if the browser is caching the file, for instance an image, when requested that file is not GET from the cache but it will get it from the parse server route. Why ? An alternative it could be to use the FSAdapter to store the files in the local storage instead of saving them in mongodb with Gridstore. All suggestion are welcome |
Referencing the closed issue #1857 which has been closed without being apparently solved, I'm looking for a way to set the Cache-Control header for files served with the standard parse server configuration, that is files which are stored on MongoDB through gridfs.
A great solution would be to be able to specify a default value for all the answers given by the FilesRouter and to further fine tune it with key-value pairs 'file extension' - 'Cache-Control value'.
I couldn't find any mention of such an option in the documentation, apart for files delivered through the S3 adapter. This seems to be an important feature when using a CDN, am I missing something such as a possibility to do it over parse through express ?
The text was updated successfully, but these errors were encountered: