WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
How to fully disable W3 in some cases (2 posts)

  1. Milan Petrovic
    Member
    Posted 4 years ago #

    There is a problem with W3 Total Cache in some cases when a large file needs to be downloaded through a PHP file that loads WP. If the file is small (under 20 MB) everything is OK, but with larger file it fails, and browser gets empty file in the end. Server logs a very strange error:

    PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 91626332 bytes) in .../wp-content/plugins/w3-total-cache/inc/define.php on line 233

    My download script sets memory to 256M, and file that needs downloading is 91626332 bytes. And line 233 is a function that tries to determine is file is XML by reading whole file to find first 4-5 characters (string functions in PHP work that way). How that was called in the first place is a mystery.

    My download script loads wp-config, and set's header elements and uses readfile, and that fails every time. Disabling W3, and this works just fine. Even if all cache methods in W3 are disabled problem is still there, as long as W3 plugin is activated. Script is in the WP plugins folder.

    How can I force W3 not to mess with the process of loading of this script or some other page maybe?

    Milan

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    You can define('DONOTCACHEPAGE'); in the script that makes the call or add that page to the never cache the following pages field on the page cache settings tab if needed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic