Viewing 4 replies - 1 through 4 (of 4 total)
  • yup.
    assuming youe w3tc setting is using disk-enhanced then this folder will continue to be recreated since it is the cache folder of your site. when u delete this folder it will regenerate each page when people visit them.

    i believe by default it has a garbage collector that can run. when i analayzed the code they seem to link the browser cache limit with the page cache garbage collecting which is a bit odd when you see how it is implemented…it would clear the entire site every time regardless of page age….very inefficient…i had to write my own patch. but thats another story.

    Ramanan

    (@superpoincare)

    Kimberly,

    I think the logic is that the garbage collection checks if pages have expired and renames them to .old . So the two need to be related.

    I don’t think garbage collection clears unexpired pages.

    Several weeks back I had originally thought the same as what you just wrote, @superpoincare, so i decided to check the code back then and found that the “.old” files (aka unexpired pages) actually get deleted after another set of time period. Its been some time so i cant recall the default amount of time it needs but if the “.old” remains long enough it actually gets deleted off disk.

    So a page life cycle is:

    1. _index.html / _index.html_gzip
    2. _index.html.old / _index.html_gzip.old
    3. (if page still isnt refreshed after xx time) then delete _index.html.old / _index.html_gzip.old

    My issue with the author’s code was that he had done something a bit inefficient (its been so many weeks so its a haze) that i had to write a small fix so that a site’s entire cached pages wouldnt be set to “.old” too soon. It was strange cuz after the garbage collection was triggered (say i want pages to expire after 7 days), even if a page was only say a few hours old (btw the author ties the browser cache timeout with garbage collection) it would deem it old too and the page would need re-caching. So there was unnecessary cpu loadage happening because virtually every page was always getting recached. With my fix it’s better behaved.

    I also had to write my own w3tc patch to allow my site to cache rss/rss2/atom/rdf feeds since w3tc does not cache these. My logs tend to show a lot of access to feeds (and hence, a lot of cpu workload) and so figured i would write a patch to make it happen. Works very well, but because i only use page_enhanced the feature is only for that.

    Ramanan

    (@superpoincare)

    Kimberly,

    IMO the life cycle is (ignoring the zip for clarity):

    1. Create index.html if it doesn’t exist. This is either created by a user request or cache primining.

    2. If there’s an index.html.old, delete it and create index.html ON user request or cache priming.

    3. The next time garbage collection runs, it turns index.html to index.html.old if the page has expired. IMO an unexpired page is NEVER changed to .old by garbage collection or by cache priming or user request. Emptying cache is an exception where all htmls are converted to .old.

    You are right, the expiry is set by browser expiry. But if you set the expiry to 1 week, I don’t think anything will delete it tomorrow unless you “empty” the cache or some other plugin empties it (or a comment or publish). Emptying actually converts pages to .old

    I haven’t observed an unexpired html file being renamed. In fact it is possible that an expired file is actually served to the user. This happens because the garbage collection runs say every hour and a page could have expired within two runs. So I am a bit surprised at your claim.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I delete page_enhanced folder?’ is closed to new replies.