WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Cache limit on file count (7 posts)

  1. Blutarsky
    Member
    Posted 1 year ago #

    Is there a way to control cached files on a count/number basis? My web plan has a 100,000 files (nodes) limit, so it is harder to keep WP Super Cache below this limit using the garbage collector. BTW the garbage collector is a resource intensive task, so in this case it would be perfect to set a limit in terms of file count, instead of running often such a resource intensive task.

    Maybe WP Super Cache could work this way:

    1) On demand set a file count limit
    2) once limit is reached, choice of:
    -- stop cache creation
    ** OR **
    -- purge older files with FIFO fashion (first in/first out)

    Any comments?

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

  2. dadaas
    Member
    Posted 1 year ago #

    Yea wp supercache is made for big sites with big traffic. But if you have a big site and cache is creating more than 10 000 files, how is this then helping the server?

    And if you are on poor Godaddy then you are toasted. they allow only 1024 files per folder. Supercache on mediocre site creates 1024 files in 3 days.

    So help me out here and tell me how can i delete old files or make cache not creating so much files in same folder.

    Or setting a limit my self and then purging old files sounds like best idea...
    LOL 1024 files... (poor daddy)

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    You need to run garbage collection more often with a shorter expiry time, and probably disable preload mode.

    The garbage collection could be more intelligent but that can be a lot more intensive on servers and/or more complicated which may lead to bugs. I don't have time to create a FIFO queue but if anyone wants to submit a patch ...

  4. dadaas
    Member
    Posted 1 year ago #

    How do i run garbage collection and how do i disable preload mode?

  5. Blutarsky
    Member
    Posted 1 year ago #

    This is could be a temporary easy solution:

    - add/enable a file/page count limit;
    - once limit is reached:
    --- stop adding pages to the cache;
    --- alert admin (email);
    --- optionally run garbage collection;

  6. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    Advanced settings page, scroll down a little to the Garbage collection settings. Go to the preload tab, there's a Preload mode checkbox ...

    Adding a count like that is expensive. The plugin would have to recurse through the cache directory counting files. How often do you run it? What is the limit?

  7. Blutarsky
    Member
    Posted 1 year ago #

    Adding a count like that is expensive. The plugin would have to recurse through the cache directory counting files.

    No recurse count needed; just keep a counter variable in a textfile (or a table). On cached pages creation, do:

    - openfile
    - readfirst & hold in mem current value
    - while generating cache, increment counter accordingly
    - on exit, writefile with updated value

    How often do you run it? What is the limit?

    - once a day (a warning states that it takes more than 30 seconds to perform)
    - Cache timeout is set to 1296000 seconds, was off
    - can't find exactly how many cached pages... stats generation halts (timeout I believe), however the "inodes" in the cache, exceed 200,000....

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic