WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] wp-cache / super-cache not caching due to theme (9 posts)

  1. mrvids
    Member
    Posted 6 years ago #

    Hi there,

    So I've been reading through all the trouble shooting for a day or so and I've tried everything that seemed relevant to me in the troubleshooting to no avail.

    then i throw a hail mary into the endzone and try swapping out my themes from my custom theme, to the classic theme. voila, caching starts working.

    How do I find out what functionality is conflicting with my custom theme and wp-cache/supercache?

    I added the line error_log(); to my advanced-cache.php but i don't see any errors in my php errors_log (that is where I would look right?).

    Any help would be greatly appreciated.

  2. mrvids
    Member
    Posted 6 years ago #

    actually, looks like i figured it out. i went through the index for the theme and just started commenting pieces out until i saw files in the cache. after commenting out the sidebar I saw that the cache dir starting populating.

    so i started commenting parts of the side bar out that had any php/wp functionality.

    in my sidebar i had:

    <? virtual ("/includes/80x80.html"); ?>

    when i commented that out, my site started caching again even with the rest of the sidebar.php code in tact.

    I changed that line to

    <? include "includes/80x80.html"; ?>

    and now caching works in its entirety. I just thought I'd share the solution, maybe it will help someone else who is banging their head on the wall ;).

  3. Donncha O Caoimh
    Member
    Posted 6 years ago #

    That was a PHP error stopping your PHP process from finishing and therefore the cache couldn't be written out. I wonder if I can add some debug code for that.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Not necessarily an error. virtual flushes all the buffers back to Apache and has Apache do a mod_include. Meaning that the output buffering you're using they might have been empty when it got to the cache. The headers would have certainly been flushed out of the buffer.

    I don't see any way to check for it other than looking through all the theme files for keywords like "virtual" and other ones that may be a problem.

  5. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Doh! You're right. I don't think I've used virtual().

    There may be a way of testing for it. I'd need to create a "Troubleshooting" button, but it could set a key of some sort at the start of a page request and if the request finishes properly the key would be deleted.
    If the key ever existed before a particular request then we'd know something went wrong.

    'Course the interesting bit is coding the key and figuring out what to base it on. ie. REQUEST_URI, $current_user..

  6. mrclay
    Member
    Posted 6 years ago #

    If "80x80.html" contains no PHP code, it needn't be parsed by PHP. Use:

    readfile('includes/80x80.html', true);

  7. MrApples
    Member
    Posted 6 years ago #

    If their were a PHP error wouldn't it say so?

    WP-Supercache is also not working for me.

  8. Donncha O Caoimh
    Member
    Posted 6 years ago #

    MrApples - it wasn't a PHP error, see Otto42's post above. Have you tried debugging it?

  9. MrApples
    Member
    Posted 6 years ago #

    Yes, I followed all the debugging instructions included in the readme.

    WP-Cache is working (but only caches 6 pages), Supercache does nothing.

    In the error log I could not find anything from WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic