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

Skip cache if request method not GET #258

Merged
merged 2 commits into from
Feb 3, 2022
Merged

Conversation

florianbrinkmann
Copy link
Member

This PR changes the Cachify::_skip_cache() method so that it returns true for all request methods that are not GET. Besides that, it adds a small modification to the .htaccess setup example, that fixes the check for the REQUEST_METHOD. We should add that to the changelog, so that users can modify their .htaccess.

Fixes #200

Copy link
Member

@pfefferle pfefferle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

@stklcode stklcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Don’t see any reasonable scenario where caching of non-GETs would make sense here, even if the POST/PUT payload was empty.

@stklcode stklcode added this to the 2.4.0 milestone Feb 3, 2022
@pfefferle pfefferle merged commit 045778c into develop Feb 3, 2022
@pfefferle pfefferle deleted the cache-delivery-only-for-get branch February 3, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

POST-Request to / receive a cached response (HDD-Cache)
4 participants