I don’t know but i had warning for this in redmod test. Why use something deprecated?
Issue with Pragma: no-cache
in HTTP Response
The Pragma
header originates from HTTP/1.0 and was originally used only in requests. Using it in responses is non-standard and may cause caching issues.Possible Problems:
- Lack of Proper Cache Control
Pragma: no-cache
only works with HTTP/1.0. Modern browsers and servers using HTTP/1.1 or HTTP/2 ignore it.
- This can lead to inconsistent behavior across different browsers and proxy servers.
- Conflict with
Cache-Control
- If
Cache-Control
is already set, Pragma
may override or contradict it, especially in older caching systems.
- Example issue:
Cache-Control: public, max-age=3600
(allows caching for 1 hour)
Pragma: no-cache
(says “do not cache”)
- This can lead to unclear behavior.
- Inefficient Caching
- A proxy server or CDN may treat
Pragma: no-cache
as a signal to completely disable caching, even if other headers specify otherwise.
- This can cause slower page loading as everything gets reloaded on every visit.
How to Fix It?
Solution: Replace Pragma: no-cache
with Cache-Control
In .htaccess
or your server configuration, use: