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
Feature Request: Specify a Vary: Accept-Encoding header #436
Comments
@raamdev I'm referencing this section of the article on Apache's I conclude from that article, that using
I'm opening another issue for the HTML Compressor that is related to this. For servers that are not using Referencing: wpsharks/html-compressor#55 Generally speaking, I don't see any harm coming from Finally, thank you for bringing this to my attention. I did not realize the impact of |
- Adding an `.htaccess` file to the public cache directory. - Public `.htaccess` file forces public access. - Public `.htaccess` sets `Vary: Accept-Encoding` header. See: wpsharks/comet-cache#436 See also: #55
I read over the article you referenced and I concur.
Yep, that sounds like a good idea to me. @jaswsinc Does closing wpsharks/html-compressor#55 close this issue? It would appear so, but I want to make sure I'm not missing anything here. |
@raamdev writes...
Yes, sure does. |
@jaswsinc no problem, I am really trying to help you guys out here lol, no hard feelings. I'm just passionate about my job. |
Next release changelog:
|
Question @raamdev @jaswsinc do we have to enable the HTML Compressor for this to be placed in the .htaccess? I ask because I am already using a separate HTML Compression plugin which works extremely well in conjunction with zencache and s2member and I don't want to switch http://codecanyon.net/item/dynamic-website-compressor/2838376 |
@ioerjfoige0439i These changes only apply to ZenCache and the ZenCache HTML Compressor. |
ok thanks. so I can still use my compression plugin and receive the benefits of this enhancement right? |
@ioerjfoige0439i writes...
Yes. The HTML Compressor generates JS/CSS part files and stores them in a special directory for public consumption. That directory now contains a new <IfModule authz_core_module>
Require all granted
</IfModule>
<IfModule !authz_core_module>
allow from all
</IfModule>
<IfModule headers_module>
<FilesMatch "\.(html|js|css)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule> If you want to use <IfModule headers_module>
<FilesMatch "\.(html|js|css)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule> Tip: You can modify the list of extensions by adding new ones to the pipe-delimited list if you like; e.g., Tip: Keep in mind that you don't need to do this if you're already using the |
This fix has been released with ZenCache v150409: If you need to follow-up with something related to this GitHub Issue, please open a new GitHub Issue. |
(Migrated this GitHub issue from an old repo.)
@ioerjfoige0439i writes...
Discovered this while running a test on http://zencache.com/features/ Please find these saved reports with the error below. W3 Total Cache doesn't produce this error when scanned on pages it's optimizing. Apparently it's as simple as adding some extra code to .htaccess (within a safe area of course as most people already have their own content in their .htaccess files).
A) http://gtmetrix.com/reports/zencache.com/ClT3KT8o
"Specify a Vary: Accept-Encoding header"
The following publicly cacheable, compressible resources should have a "Vary: Accept-Encoding" header:http://zencache.com/wp-content/cache/zencache/htmlc/public/zencache-com/1/9/5/a/f/f9823164268a8dcd6a6fce0cee440434-compressor-part.js
"Bugs in some public proxies may lead to compressed versions of your resources being served to users that don't support compression. Specifying the Vary: Accept-Encoding header instructs the proxy to store both a compressed and uncompressed version of the resource."
B) http://tools.pingdom.com/fpt/#!/bt2A6p/http://zencache.com/features/
"Specify a Vary: Accept-Encoding header"
The following publicly cacheable, compressible resources should have a "Vary: Accept-Encoding" header: http://zencache.com/wp-content/cache/zencache/htmlc/public/zencache-com/1/9/5/a/f/f9823164268a8dcd6a6fce0cee440434-compressor-part.js
I've seen some suggestion to fix this such as:
http://www.fastly.com/blog/best-practices-for-using-the-vary-header/
or here:
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
or here:
http://stackoverflow.com/questions/3641197/how-to-specify-vary-accept-encoding-header-in-htaccess
here's what I have in my .htaccess (which btw could be wrong as I wrote this a long time ago and am running the vary accept code twice because I don't know proper apache code lol):
The text was updated successfully, but these errors were encountered: