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

Set the cache headers for static resources #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

megawac
Copy link

@megawac megawac commented Mar 12, 2014

Set the cache headers on static resources for 30 days

Wrote this for my fork; figured you guys may be interested in this change

Accept-Ranges: bytes
Cache-Control: max-age=2592000, public
Connection: keep-alive
Content-Encoding: gzip
Content-length: 0
Date: Wed, 12 Mar 2014 16:18:57 GMT
Expires: Fri, 11 Apr 2014 00:00:00 GMT
Last-Modified: Wed, 12 Mar 2014 15:06:01 GMT
Server: TwistedWeb/13.1.0

Edit - just noticed I forgot to remove a debug statement in caching - my bad

@mrflea
Copy link
Contributor

mrflea commented Apr 7, 2014

I'm worried that caching for 30 days is a bit long (mostly because this includes the JavaScript as it is 'static content'). I'll think about this pull request a bit more.

@megawac
Copy link
Author

megawac commented Apr 7, 2014

Ya, honestly I didn't think too much in to the period and probably add an option to set it in the config file. Would you like me to patch without the debug statement and an option in the config for the period.

Edit also don't the JS and css files get given a random hash suffix on compile? So that shouldn't be a concern

Add an option to set the duration of the cache. 30 day default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants