• Resolved dannny1973

    (@dannny1973)


    Firstly, kudos to the developer for this awesome plugin.

    Have been using since 6 years now on my WordPress blog. Never faced an issue apart from this one below:

    I had set Page Cache to Disk Enhanced and it was working great until one day my website refused to open. Upon inspection, I realized that the cache folder (/var/www/domain.com/htdocs/wp-content/cache) was ~950GB and my server disk space was 950GB. So it had basically eaten up all disk space, not allowing other services to run properly.

    A bit of context: My site is 6 years old. Have 24,000 posts and 100GB of wp-upload folder.
    Server specs:

    48GB RAM
    960GB SSD drive
    12 core processor
    LEMP stack

    So W3TC was caching all my articles (even from 2014, 2015 etc) as per my sitemap. Upon more inspection, I realized that it takes sitemap priority to build the cache over time. But in my case it made little sense as my website is a news site. And news from last year or last month is already stale and I don’t get a lot of visits on those.

    So is there a way, we can add rules to nginx so that disk enhanced caches most recent articles (say latest till last 2 weeks) and maybe if someone accesses an old post (say from last year) the page is cached.

    I have full access to my server, can make nginx entries. Since I didn’t know what rules to enter, I switched from disk enhanced to Memcache for Page Caching (size 4GB), but it’s very slow compared to Disk Enhanced. It was the best.

    Can you please guide me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @dannny1973

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    If I understand correctly, and please correct me if I am wrong, you are using the Cache Preload feature to preload the cache of your website?
    If that is the case, this means that the cache preload is preloading all of your pages.
    Also, make sure to check the folders in the /cache/ folder and see which one takes up the most of the space. For example, if you also have DB cache, object cache, and minify all caching to disk, you should consider using Memcached for DB cache and Object cache and manually delete the Object and Cache folder from the /cache/ folder.
    As for the Nginx rule, no rule specifies which page should be cached. When using Cache Preload you can create a custom sitemap, containing only the most recent URLs and run the preload. This will ensure that all other older pages are not cached. It’s also safe to delete the page_enhanced folder from the /cache/ folder as well.
    If you do not wish to use cache preload then the page will be cached once visited. This being said the Cache Prewload might not be the best solution for your website.
    In any case, it’s safe to delete the content in the cache folder as the pages will be cached again.
    I hope this helps!
    Thank you!

    Thread Starter dannny1973

    (@dannny1973)

    Hi Marko, thank you so much for the detailed response.

    I’m using the following:

    Page Cache: Disk Enhanced (now Memcached)
    Object Cache: Memcached
    DB Cache: none
    Minify: none (doing it at Cloudflare end)

    As you said, cache preload is not the best solution for my website. Can I just uncheck preload and use Disk Enhanced as Page Cache, then pages visited by users will be cached, right? Correct me if I’m wrong. Or do you suggest I build a custom sitemap with just the last posts from the last (say one month) and use it for preload?

    Also, I’ve set Memcached size to 4GB for Object Cache only. Is that sufficient or do you recommend some other setting. Also, Object Cache is faster on disk (there’s no disk enhanced option) or Memcached?

    • This reply was modified 5 years, 10 months ago by dannny1973.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @dannny1973

    Yes, you should uncheck Automatically prime the page cache, delete the cache/page_enhaced folder, and use Disk Enhanced as a caching solution. this way once the page is visited it will be cached. You can leave Memcached for the Object cache.
    Memory Cache” stores and loads resources to and from Memory (RAM). So this is much faster but it is non-persistent. Content is available until you close the Browser.
    “Disk Cache” is persistent. Cached resources are stored and loaded to and from disk. So yes, Memcached is faster for object caching.
    You can also manually delete the cache/object/ folder
    Thanks!

    Thread Starter dannny1973

    (@dannny1973)

    Thank you so much, Marko!

    I’ve made the changes & the site is visibly faster now. But I’ve used disk for Object Cache now. Should I change it to Memcached?

    What do you mean by “Content is available until you close the Browser.” Are you talking about the website user? Because if that’s the case, we want something persistent. It’s a news site and most people just read one article and leave the site (mostly). And we get many such new users on the same news piece. Can you message you somewhere where I can share the site url privately? Telegram or email etc?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @dannny1973

    Sorry, this I meant this for HTML caching.
    By default, the object cache is non-persistent. This means that data stored in the cache resides in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads unless you install a persistent caching solution.
    Using Memcached as a caching method in W3TC for object caching provides a persistent backend for the WordPress object cache and it’s lot faster.
    Thanks!

    Thread Starter dannny1973

    (@dannny1973)

    Thank you. I have unchecked two things under Page Cache:

    Automatically prime the page cache
    Preload the post cache upon publish events

    But when I look into folder /var/www/domain.com/htdocs/wp-content/cache/page_enhanced/www.domain.com/ I can see that there are cache of all pages A-Z (current folder size is 36GB). It’s not latest, the cache has folders that are posts from 2013, 2014 etc.

    Why is this happening?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @dannny1973

    As I’ve stated in the previous posts, you can safely delete the /page_enhanced/ folder manually.
    This will ensure that all of the don’t cached pages are no longer in the cache folder and only newly cached pages will be stored there.
    Thanks!

    Thread Starter dannny1973

    (@dannny1973)

    Thank you so much!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Page Cache disk enhanced customize rule’ is closed to new replies.