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

Setting Cache-Control header #252

Open
mattstudio opened this issue Aug 9, 2016 · 1 comment
Open

Setting Cache-Control header #252

mattstudio opened this issue Aug 9, 2016 · 1 comment

Comments

@mattstudio
Copy link

The default cache-control is set to max-age=604800 (one week). How can I change this? (Apart from editing file.py)

Ideally, my html pages would have a max-age=0, while images, css, and javascript would have a max-age= a month or something.

Any ideas how this could be done? Is there a way to specify this on each page? Or in some sort of plugin?

@sergadin
Copy link

sergadin commented Sep 6, 2016

+1

It seems that one can create a plugin like that

def preDeployFile(file):
    cache_expiration = 60 * 60 # One hour
    if file.path.endswith('.html'):
        file.cache_control = cache_expiration

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

2 participants