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

Make cache control header evaluate at runtime #224

Open
danielunderwood opened this issue Oct 3, 2022 · 0 comments
Open

Make cache control header evaluate at runtime #224

danielunderwood opened this issue Oct 3, 2022 · 0 comments

Comments

@danielunderwood
Copy link
Contributor

danielunderwood commented Oct 3, 2022

At

async def add_cache_control_header(response, expiry = provider.utcnow() + timedelta(seconds=app.config['CACHE_TTL']['cloudflare'])):
, the time being passed as a parameter will cause it to be evaluated at the time the function is defined, rather than on each call. The conventional way to do this would be to change the default value to None and generate the value if it is set to None.

Fortunately, it seems that all calls to this function specify the expiry parameter, so it may not be causing any issues.

AB#3869

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