• Resolved chaklesh

    (@chaklesh)


    Since few months, W3 Total Cache is getting buggy. There was a time, This one was my favorite caching plugin but now it has a lot weird behaviour. While installing W3 Total Cache getting Warning:-

    The plugin generated 228 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

    . Somehow installed. I am fed up of these issues. The list of problems goes below:-
    1. My Server has brotli, so turned off gzip. Now Cache Control is

    cache-control: max-age=3597, public, public

    Why public-public twice, if i turn on gzip it is back to single public.
    2. On HTML pages, vary:Accept-Encoding,Cookie . I want to remove this as i am not compressing so why accept encoding. This vary header is already set by my server if i use brotli. So vary Header is:

    vary: Accept-Encoding
    vary: Accept-Encoding,Cookie

    3. On other than HTML Requests like css, js. Vary Header is

    vary: Accept-Encoding,X-Forwarded-Proto

    How can i remove these and solve the issues. I need clean vary: Accept-Encoding only once for Google Cloud CDN as anything appended other than this to vary leads to no cache of resource.
    Hope get fix soon

    • This topic was modified 4 years, 1 month ago by chaklesh.
    • This topic was modified 4 years, 1 month ago by chaklesh.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @chaklesh

    I am sorry about the issues you are experiencing and I am happy to assist you with this.
    It seems like you have double BC rules set either on your server (.htaccess/nginx) or you are using some CDN like Cloudflare or other CDN provider that is also setting the BC rules.
    Try disabling Browser Cache in W3 Total Cache General settings, save all settings, and purge the cache.
    Check your headers after that. If you are still seeing Cache-Control, vary: Accept-Encoding, and vary: Accept-Encoding, X-Forwarded-Proto it means that something else is setting these.
    We haven’t been making any changes in W3 Total Cache in the past few months related to browser cache so possibly this is an issue with your environment.
    Please make sure to share your website URL so we can check if possible and please let me know the result once Browser Cache is disabled.
    Thanks!

    Thread Starter chaklesh

    (@chaklesh)

    if i remove page cache core code from htaccess, then vary has no cookie or X-Forwarded-Proto. Is there any way to disable this page cache core code in htaccess. The site is https://spot.nayag.com

    Thread Starter chaklesh

    (@chaklesh)

    If i deactivate the W3 Cache Plugins all vary headers X-Forwarded-Proto and Cookiees are removed. The vary header from my server

    vary: Accept-Encoding

    is added only if i use brotli compression of my server if i don’t use brotli it gets removed automatically. The problem is while Using the W3 Total cache plugin.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @chaklesh

    Thank you for the information.
    The accept-encoding is set only when compression is on (gzip or brotli). So you need to make sure both options are off in this case.
    Thanks!

    Thread Starter chaklesh

    (@chaklesh)

    i don’t want to Completely remove

    vary: Accept-Encoding

    What i want to remove is just the appended no cookie or X-Forwarded-Proto from

    vary: Accept-Encoding,Cookie

    and

    vary: Accept-Encoding,X-Forwarded-Proto

    .
    I need plain

    vary: Accept-Encoding

    .
    Have you got my point. Now, how can i achieve the same. These are appended by W3TC Page Cache core rules in htaccess, but if i remove these rules. It gets automatically inserted by plugin. Anyway to get rid of these appended header terms??

    • This reply was modified 4 years, 1 month ago by chaklesh.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @chaklesh

    Thanks for the info.
    Disable Page Cache, disable Gzip, and Brotli compression in Browser Cache.
    Delete the W3TC Page Cache core rules from the .htaccess file and save the file.
    Reload your website and let me know if you have a plain vary: Accept-Encoding
    Thanks!

    Thread Starter chaklesh

    (@chaklesh)

    After disabling W3TC completely, i am getting plain vary:Accept-Encoding. I am sure these are being added by W3TC. Can you please tell me, which option of W3TC is adding these. Please let me know a way to disable these.
    Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @chaklesh

    As I mentioned in the previous post, you need to disable Page Cache, delete the W3TC Page Cache core rules from the .htaccess file, and disable Brotli and Gzip in the Browser Cache settings.
    Thanks!

    Thread Starter chaklesh

    (@chaklesh)

    I have done everything you mentioned. I am getting plain vary header but i also need to use W3TC for caching and set the cache control headers. Isn’t there any way to just remove these terms from vary header and i also keep using W3TC plugin for caching. Have you any idea which part of plugin is adding these.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @chaklesh

    Thank you for the information.
    The Page Cache and the Brotli and Gzip are setting those.
    SO if you want’ to have plain vary: Accept-Encoding you should disable them as suggested above.
    Thanks!

    Thread Starter chaklesh

    (@chaklesh)

    Even after disabling these, i m not getting plain vary header. But after disabling W3TC completely, i m getting vary plain. The problem is htaccess Page cache core rules which can not be removed even after disabling option in W3TC cache..these can only be removed after deactivating plugin. If i remove these core rules manually from htaccess, these are added automatically by plugin.Is there any way to remove core rules from htaccess and also keep using W3TC.
    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘W3 Total Cache Brotli, Gzip and Header Problem’ is closed to new replies.