8000 Only allow caching for GET and HEAD requests by swalkinshaw · Pull Request #1435 · roots/trellis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only allow caching for GET and HEAD requests #1435

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

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

swalkinshaw
Copy link
Member

ref #1434 (comment)

Thanks for the reminder @PDowney

cc @craigpearson

@craigpearson
Copy link
Contributor

Thanks for the input and attention all. Based on the original suggestion here and comments here, would you see any issue tackling this with:

if ($request_method !~ ^(GET|HEAD)$) {
    set $skip_cache 1;
}

I remember reading something many moons ago that this type of if statement is "evil" but based on the list of HTTP methods there isn't much room for any unknowns?

@swalkinshaw swalkinshaw force-pushed the skip-options-requests-for-caching branch from 77dc781 to 19130bf Compare October 15, 2022 15:32
@swalkinshaw swalkinshaw changed the title Skip cache for OPTIONS requests Only allow caching for GET and HEAD requests Oct 15, 2022
@swalkinshaw
Copy link
Member Author

@craigpearson yeah works for me 👍

@swalkinshaw swalkinshaw merged commit d73567e into master Oct 15, 2022
@swalkinshaw swalkinshaw deleted the skip-options-requests-for-caching branch October 15, 2022 17:24
paulbrzeski pushed a commit to paulbrzeski/trellis that referenced this pull request Mar 3, 2023
paulbrzeski pushed a commit to paulbrzeski/trellis that referenced this pull request Mar 3, 2023
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.

2 participants
0