WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP File Cache] Plugin not caching persistently (6 posts)

  1. shidouhikari
    Member
    Posted 4 years ago #

    Very sad :(

    I loved your plugin but when I did some extra tests I saw it's not working at all.

    I've made a bunch of debugs and @file_put_contents() IS writing cache files, it returns some amount of bytes being written and files ARE being saved on database.

    But then something I can't discover what delete these files, even before a new page load happens. And when I reload the page, cache is empty, $files is an array without any data inside.

    On every page load wp_cache_get() always return false on first attempt, my plugin queries data from database and wp_cache_set() it. Next wp_cache_get() attempts return cache, but on next page load cache is gone again.

    I've tested it on an development environment that only I have access and I know nobody else is accessing it, tried being logged in and off.

    Maybe it's something related to apache or php, glob() simply returns empty array and something deletes files just after they are created. You plugin doesn't have a chance to file_get_contents() because empty($files) is always true, but I can't understand what may be deleting them if file_put_contents() creates them.

    Do you have any suggestion of what I can try to fix it?

    http://wordpress.org/extend/plugins/wp-file-cache/

  2. shidouhikari
    Member
    Posted 4 years ago #

    Files are for sure being written.

    When cache is gonna be read, glob() returns an empty string, and then funtion returns.

    I've used print_r($files); and pratically always it prints Array ( )

    So I see 2 possibilities, glob() is deleting cache files, or something else is deleting them and when glob() runs it finds nothing.

  3. shidouhikari
    Member
    Posted 4 years ago #

    When cache is gonna be read, glob() returns an empty ARRAY I mean

  4. shidouhikari
    Member
    Posted 4 years ago #

    Problem solved!

    A plugin was flushing the cache EVERY time it does a get_option()... It seems its author uses AJAX in plugin admin page and maybe options were cached and weren't being updated, so he got angry with cache.

    I removed flush line and it worked :)

  5. Vladimir Kolesnikov
    Member
    Posted 4 years ago #

    What plugin was that?

  6. shidouhikari
    Member
    Posted 4 years ago #

    NAVT :p

    It's the best menu generator for WordPress, but its author is somehow temperamental, probably he had problems with cache and decided to solve it flushing the whole cache. I removed the call and cache worked.

Topic Closed

This topic has been closed to new replies.

About this Topic