User tests: Successful: Unsuccessful:
When the compression of the response is delegated to Apache with mod_deflate, two headers are set during the compression:
Content-Encoding: gzip
Vary: Accept-Encoding
Vary: Accept-Encoding is important to prevent proxies, intermediate caches, or CDNs from serving compressed resource to clients that does not support compression and vice versa.
"Vary: Accept-Encoding" header specifies that caches should only be used if the incoming request matches the "Accept-Encoding" information in the cache.
When the mod_deflate is disabled in the web server, and the compression is delegated to Joomla through Global Configuration → Server → Gzip Page Compression, in this case the header "Content-Encoding: gzip" is set, but "Vary: Accept-Encoding" no, which causes the problem mentioned above on modern networks.
Disable mod_deflate in your web server and enable Joomla compression Global Configuration → Server → Gzip Page Compression.
Browse any page.
Check that the response headers include Vary: Accept-Encoding in addition to Content-Encoding: gzip
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Category | Libraries | ⇒ | Libraries Unit Tests |
I have tested this item
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Status "Ready To Commit".
It took some time but thanks for adding this header to Joomla.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-09-17 16:21:22 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
It is not only about older browser seeing corrupted HTML
There is 1 more reason to add this
and thus have proxies, etc store both compressed and uncompressed version
If an old browser (or some browser) is the first to request a content as uncompressed
then the proxy will cache only the uncompressed content
and it will serve it to browsers that can accept compressed content
thus having worst responce time