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

Fixes 609 - Implements a caching policy for HTML resources #1415

Merged
merged 4 commits into from
Mar 27, 2017

Conversation

karlcow
Copy link
Member

@karlcow karlcow commented Mar 9, 2017

Hopefully I didn't break anything this time.
A couple of things have changed. So review when you have time
r? @miketaylr

@karlcow karlcow requested a review from miketaylr March 9, 2017 06:37
Copy link
Member

@miketaylr miketaylr left a 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. 👍

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.

This comment was marked as abuse.

@@ -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.

This comment was marked as abuse.

This comment was marked as abuse.

@@ -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.

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

Successfully merging this pull request may close these issues.

3 participants