-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fixes 609 - Implements a caching policy for HTML resources #1415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a tiny comment fix. If I understand the code that I commented on -- then feel free to merge. 👍
tests/test_http_caching.py
Outdated
import webcompat # nopep8 | ||
|
||
# Any request that depends on parsing HTTP Headers (basically anything | ||
# on the index route, will need to include the following: environ_base=headers |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -147,6 +147,7 @@ def index(): | |||
|
|||
|
|||
@app.route('/issues') | |||
@cache_policy(private=True, uri_max_age=0, must_revalidate=True) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
- also fixes a comment (minor)
@@ -489,3 +491,36 @@ def add_csp(response): | |||
"style-src 'self' 'unsafe-inline'; " + | |||
"report-uri /csp-report" | |||
) | |||
|
|||
|
|||
def cache_policy(private=True, uri_max_age=86400, must_revalidate=False): |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Hopefully I didn't break anything this time.
A couple of things have changed. So review when you have time
r? @miketaylr