- AuthorPosts
- October 28, 2022 at 12:24 pm #65175krojewGuest
Hi,
I found a potential problem with the W3 Total Cache plugin – even with every cache and compression options disabled after running the initial setup, data is still being compressed with gzip. This is a serious problem when using plugins which affect downloading media files – PHP caches those files in memory, rather than streaming to the client. This in turn causes large spikes in memory consumption. Is there a way to force the plugin to not enable (directly or indirectly) gzip?October 28, 2022 at 12:31 pm #65288Marko VasiljevicKeymasterHello,
Thank you for reaching out and I am happy to assist you with this.
The W3 Total Cache has the option for Gzip and you can find this option in Performance>Browser Cache, in the General box for all types of files or you can enable/disable it for individual files type.
If the Gzip compression is disabled, then the W3 Total cache does not compress any files.
You can check this by checking the .htaccess file for any mod_deflate-related W3TC rule.
Can you please share your settings and also share the URL so I can see if the files are indeed gzipped?
Thanks!October 31, 2022 at 1:52 pm #65647krojewGuestThe options are disabled – the act of turning on the plugin simply enabled gzip. Unfortunately, I cannot give you a link to a live website, since it serves files which can have hundreds of MB, and given the above, this can eat up server RAM quite fast. I can say I use the plugin with conjunction with the Prevent Direct Access plugin, which uses readfile() to serve files. Adding the PDA plugin file path to the ignore patterns doesn’t turn off gzip for that path too, which implies the compression is somehow implicitly enabled by W3 Total Cache.
October 31, 2022 at 1:54 pm #65671Marko VasiljevicKeymasterHello,
Thank you for your feedback.
Can you confirm that the problem persists if the W3TC is disabled?
Have you confirmed that once the gzip is disabled in Performance>Browser Cache, the .htaccess rules for mod_deflate are no longer there?Thanks!
November 1, 2022 at 12:57 pm #65673krojewGuestI can confirm enabling W3 Total Cache creates the issue, while disabling the plugin solves it. I can also confirm after enabling the plugin without enabling browser cache at all, the server started using gzip for downloading files protected by the PDA plugin. The .htaccess file in the root directory has the same size regardless if the plugin is enabled – should I look at some other .htaccess?
November 1, 2022 at 1:40 pm #65857Marko VasiljevicKeymasterHello,
Thank you for your feedback.
So to clarify, When W3 Total Cache is active, regardless if any option in the plugin is active or all are disabled you are still experiencing the problem?
If this is the case, I am sorry but without knowing more about the server configuration and the website URL, I cannot share any specific instructions on how to Remedy this.
The reason for this is that if the W3TC is installed and active, and all the settings are disabled, it means that the W3TC does not have any impact on your website.
The W3TC uses the .htaccess in the root folder of the website. If the gzip compression is enabled for the HTML files for example you will have the following rules within the W3TC Browser cache rules block:<IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/richtext text/plain text/xsd text/xsl text/xml <IfModule mod_mime.c> # DEFLATE by extension AddOutputFilter DEFLATE js css htm html xml </IfModule> </IfModule>
You can also see the content-encoding: gzip header.
Tanks!November 2, 2022 at 12:31 pm #65866krojewGuestThe website in question is https://anxiouscat.studio/ – I can provide you with any server information you desire.
November 2, 2022 at 12:34 pm #66073Marko VasiljevicKeymasterHello,
Thank you for your feedback.
I’ve checked your website and I can see the Content-Encoding: gzip header, which means that even if the W3TC is disabled, something is setting the gzip compression on a server level or any other plugin that you may be using.
Check if the gzip compression is enabled on a server level with your host, and make sure that zlib.compression is disabled also.
Once again, something is setting gzip compression and it’s not related to the W3 Total Cache.
Thanks!November 3, 2022 at 11:08 am #66075krojewGuestRight now, gzip is enabled for pages other than media files using other methods than W3TC, since the problem in question with W3TC. When W3TC is enabled, everything suddenly gets gzipped, including files served by the PDA plugin. That’s why you’re seeing gzip now for normal pages.
November 3, 2022 at 11:14 am #66392Marko VasiljevicKeymasterHello,
Thank you for your feedback.
I am sorry but I am simply not able to replicate the problem. I disabled the Gzip in the Browser Cache settings and the Gzip is no longer active, therefore W3TC does not have any impact on the compression.
Can you please let me know if the W3TC is currently enabled (I’ve checked the website and it does not seem to be active)
Thanks!November 3, 2022 at 11:19 am #66393krojewGuestW3TC is currently disabled, due to this issue. Have you tested this with the PDA plugin and a protected file?
November 3, 2022 at 11:30 am #66398Marko VasiljevicKeymasterThank you for your feedback.
Well, I’ve checked the website and all the files are gzipped.
can you please share what is the other method you are using for gzip? Also, share the files(pages) that are having the problem, so I can check that also.
I’ve added this plugin, added the page to Customize “No Access” Page and this page was not compressed with gzip or br.
Is this the plugin you are referring to?
Thanks!- This reply was modified 2 years, 1 month ago by Marko Vasiljevic.
November 4, 2022 at 1:53 pm #66401krojewGuestYes, this is the plugin. If you turn on file protection on a given file in a media library, the file will not be gzipped when using the protected link, even if the rest of the whole page is. But if W3TC gets enabled, then the gzip compression will be turned on for protected links (PDA uses /private/ prefix for such files).
November 4, 2022 at 1:55 pm #66694Marko VasiljevicKeymasterThank you for your feedback.
Again I was not able to replicate this with this plugin.
Are you using the paid version of the plugin with the advanced settings?
Thanks!November 7, 2022 at 12:25 pm #66696krojewGuestNo, I’m using the free version. When you download a protected file, is it streamed from readfile() or is it first cached into memory by php?
- AuthorPosts
- The topic ‘Compression error’ is closed to new replies.