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

The Cache-Control header is removed from cache hits #712

Open
szepeviktor opened this issue Aug 1, 2024 · 8 comments
Open

The Cache-Control header is removed from cache hits #712

szepeviktor opened this issue Aug 1, 2024 · 8 comments

Comments

@szepeviktor
Copy link
Contributor

Response without cache, e.g. a POST request

Cache-Control: no-cache, no-store, must-revalidate, max-age=0

with cache, e.g. a GET request: the Cache-Control header is missing meaning

This response allows caches to assign their own freshness lifetimes to it.

Please advise. It is intentional?

@timotei-litespeed
Copy link
Contributor

Most of the time we leave Cache-Control as it was set before.
There is one exeception: the one you wrote above :)

@szepeviktor
Copy link
Contributor Author

@timotei-litespeed Thank you for your response.

In what WordPress filter can I add a Cache-Control header?
Or in htaccess?

@timotei-litespeed
Copy link
Contributor

@szepeviktor sorry for late answering
We use default PHP functions to change headers: https://www.php.net/manual/en/function.header.php also you can use: https://www.php.net/manual/en/function.get-headers.php to see the headers

@timotei-litespeed
Copy link
Contributor

@szepeviktor what is the status of the question?

@szepeviktor
Copy link
Contributor Author

I'd like you to (optionally?) copy the Cache-Control header from the original response.

@timotei-litespeed
Copy link
Contributor

timotei-litespeed commented Sep 10, 2024

@szepeviktor reading over your last question I saw you asked where you can change header.
We change header in these actions(at least): wp_loaded shutdown

What if your end result? What do you wat to achieve?

@szepeviktor
Copy link
Contributor Author

What do you want to achieve?

I want the keep the original Cache-Control header in the cached version of a page.

@timotei-litespeed
Copy link
Contributor

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

2 participants