Gzip In Cpanel
-
Hi, In cpanel there is an option to compress content (gzip). If this is enabled do we need to enable gzip compression in the Comet Cache options? Thanks
-
@martychc23 You shouldn’t need to enable it in Comet Cache if it’s already enabled in cPanel. The best thing to do is run a test on your site after enabling GZIP to confirm it has been enabled. I recommend https://checkgzipcompression.com/.
ok, i didn’t think so. Just wanted to check as i’ve just switched to Comet Cache.
Actually what made me switch was that CC outputs security headers when i have them configured. This was something i was unable to do with other caching plugins.
There is one header i haven’t been able to output, however, and that is “referrer policy”. Is it possible to output this security header with CC?
// Referrer Policy
header(‘Referrer-Policy: no-referrer-when-downgrade’);@martychc23 Can you explain how you’re adding those headers? Are you using a plugin?
I’ve added the following by putting them in my functions.php
// Security Headers
add_action(‘send_headers’, function(){
// Enforce the use of HTTPS
header(‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’);
// Referrer Policy
header(‘Referrer-Policy: no-referrer-when-downgrade’);
}, 1);And the rest were added by Shield Security plugin (https://en-gb.wordpress.org/plugins/wp-simple-firewall/)
The referrer policy header was the only one i couldn’t get working as tested here:
@martychc23 Does the
Referrer-Policyheader work if you disable Comet Cache?yes, it also works when serving a page for the first time (uncached) with CC enabled.
Just another quick question, does CC output the “If-Modified-Since HTTP header” as i’ve noticed it’s missing since installing the plugin?
Regarding the
Referrer-Policyheader: We need to add that to the Comet Cache HTTP Header Whitelist so that it doesn’t get stripped out when serving cache files. I’ve opened a Feature Request for this here and we’ll see if we can this added in the next release (coming within the next few weeks): https://github.com/websharks/comet-cache/issues/892Regarding the
If-Modified-Sinceheader: Comet Cache support this for static resources (e.g., images, CSS, JS, etc.) but not for serving the cache files themselves. WordPress Core itself used to strip out theIf-Modified-Sinceheader and Comet Cache was following their lead on that, but it looks like WordPress Core has since added support forIf-Modified-Since. Comet Cache now needs to be updated to do the same. We have a long-standing GitHub issue open about this and I just posted an update with the latest information; see my comment here: https://github.com/websharks/comet-cache/issues/255#issuecomment-304394481Thanks for updating me on these issues. I read the feature requests you linked to and noticed you mentioned CC supports the ETag headers. Could you tell me if i should keep or remove the following in my htaccess?
<IfModule mod_headers.c>
Header unset ETag
FileETag None
</IfModule>@martychc23 Comet Cache Pro adds the following to the
.htaccesswhen you enable Leverage Browser Caching. If you want to enable Browser Caching, here’s what you can use:# Enable browser caching. FileETag mtime size <IfModule expires_module> ExpiresActive on ExpiresDefault "access plus 1 week" </IfModule>great, thanks for your help!
The topic ‘Gzip In Cpanel’ is closed to new replies.