• Resolved hydrogriff

    (@hydrogriff)


    Hi,

    This happened the next day I installed W3TC on three of my clients sites. All three of them are hosted on a different server, running different sets of plugins. All the sites, when visited from a browser shows a download box, asking the visitor to download ‘download.gz’.

    I am not sure how to fix this. Purging the cache works, but it starts happening again in a few days. Removing W3TC stops the issue from happening.

    I have currently removed W3TC and temporarily added Super Cache. Any fix?

    • This topic was modified 5 years, 4 months ago by hydrogriff.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hydrogriff,
    I am sorry about the issue you are experiencing with download.gz but I am happy to assist you with this.
    W3TC_PAGECACHE_STORE_COMPRESSION_OFF constant allows not to generate
    _gzip and similar files. It helps in the cases when server configuration
    doesn’t allow mime type overwrites so cached content ends up with browser
    download action.
    It’s located in /wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php line 1191

    if ( defined( 'W3TC_PAGECACHE_STORE_COMPRESSION_OFF' ) ) {
    			return $compressions;
    		}

    You just need to add define('W3TC_PAGECACHE_STORE_COMPRESSION_OFF', true);

    to the wp-config.php file.

    I hope this helps

    Thread Starter hydrogriff

    (@hydrogriff)

    Thank you for the detailed response Marko. I would like to know what is the issue here. Should I add the fix in the wp-config (which I assume will stop W3TC from storing .gzip files)? Or should I configure my server to allow MIME type overrides?

    If it’s the latter, could you show me a hint on how to do that?

    Loaded Modules:
     core_module (static)
     so_module (static)
     watchdog_module (static)
     http_module (static)
     log_config_module (static)
     logio_module (static)
     version_module (static)
     unixd_module (static)
     access_compat_module (shared)
     alias_module (shared)
     auth_basic_module (shared)
     authn_core_module (shared)
     authn_file_module (shared)
     authz_core_module (shared)
     authz_host_module (shared)
     authz_user_module (shared)
     autoindex_module (shared)
     deflate_module (shared)
     dir_module (shared)
     env_module (shared)
     expires_module (shared)
     filter_module (shared)
     headers_module (shared)
     mime_module (shared)
     mpm_prefork_module (shared)
     negotiation_module (shared)
     php7_module (shared)
     reqtimeout_module (shared)
     rewrite_module (shared)
     setenvif_module (shared)
     socache_shmcb_module (shared)
     ssl_module (shared)
     status_module (shared)

    These are the active modules from one of the servers.

    • This reply was modified 5 years, 4 months ago by hydrogriff.
    • This reply was modified 5 years, 4 months ago by hydrogriff.
    Thread Starter hydrogriff

    (@hydrogriff)

    Hi. Kindly check my previous reply. As I edited it to add a code snippet, the spam filter caught it into moderation. I have added some info.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hydrogriff,

    The fix I provided will solve your download.gz issue. As for the server, you should contact your host/server admin for assistance.

    Thread Starter hydrogriff

    (@hydrogriff)

    Thanks.

    As I mentioned in the previous response, I would like to know what the issue is. Does the fix disable gzip compression totally? What does the fix do?

    And about the server, I am the one who maintains it. I see that mime_module is installed. Just not sure where should I start looking for the config. I am a junior developer and I have little experience with core server configs. If it’s not too much to ask, can you point me to the documentation that deals with MIME handling configs – so that I can reproduce the issue in a test server and check if I can find what’s causing the issue.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @hydrogriff,

    The problem with downloading gzip files is probably that there already is a configuration in the setup that handles gzip files. If you enable gzip in Performance => Browser Cache => HTML & XML, the configuration gets messed up and the browser will download a gzip file in situations like yours. Disabling the gzip option in Performance => Browser Cache => HTML & XML will probably solve this issue.

    Thread Starter hydrogriff

    (@hydrogriff)

    Thank you for the clarification.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Browser tries to download download.gz instead of showing the page’ is closed to new replies.