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

Return cached pages only if request method is GET or HEAD #32

Closed
tobiasfabian opened this issue May 13, 2024 · 0 comments
Closed

Return cached pages only if request method is GET or HEAD #32

tobiasfabian opened this issue May 13, 2024 · 0 comments

Comments

@tobiasfabian
Copy link

If the request method is POST, PUT, or similar, no cached pages should be returned.

The following could be added to the index.php (compare to $page->isCacheable())

(function /* staticache */ () {
	// check if request method is not GET or HEAD
	if (in_array($_SERVER['REQUEST_METHOD'], ['GET', 'HEAD']) === false) {
		return;
	}

	// …
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