Skip to content

Occasional problem of corrupted html#79

Merged
mbabker merged 2 commits intojoomla-framework:masterfrom
demis-palma:accept-encoding
Feb 24, 2018
Merged

Occasional problem of corrupted html#79
mbabker merged 2 commits intojoomla-framework:masterfrom
demis-palma:accept-encoding

Conversation

@demis-palma
Copy link
Contributor

@demis-palma demis-palma commented Feb 2, 2018

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.

Testing Instructions

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

Note

See joomla/joomla-cms#19525

@demis-palma
Copy link
Contributor Author

Should I submit the patch to the branch "2.0-dev" also?

@mbabker
Copy link
Contributor

mbabker commented Feb 2, 2018

Should I submit the patch to the branch "2.0-dev" also?

No need. Similar to the CMS patches get merged up across supported branches (so here master is merged to 2.0 like staging is merged to 4.0).

@mbabker mbabker merged commit 5d2e64a into joomla-framework:master Feb 24, 2018
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

Successfully merging this pull request may close these issues.

2 participants