• Resolved kwstas778

    (@kwstas778)


    Hello. I’m using Preload with expert mode in advanced settings and “Refresh preloaded cache files every 0 minutes” since I want to preload my cache only when I make changes to my website. My issue is, when I hit the “Preload Cache Now” button, the process starts after 10 seconds, and in the pages showed as preloading, my homepage https://thomaslaw.gr/ is not preloaded. When it finishes, I go to Contents tab and hit show list of cached files and every page is cached except from my homepage. Checking this site https://www.giftofspeed.com/cache-checker/ and it shows that my homepage is indeed not cached.

    Another weird thing is, although I’m using preload mode, if I open my homepage into a browser and then Regenerate Cache Stats, my homepage shows as cached. How is that possible? I’m using preload mode, so the thing should be cached when I hit the preload button, not when someone visits the page, right? Then I check the site linked above (https://www.giftofspeed.com/cache-checker/) and it shows my homepage as cached but only with 3 seconds duration. This is relevant to this post (https://www.ads-software.com/support/topic/homepage-is-only-being-cached-for-3-seconds/) in which another user has a problem with homepage caching for only 3 seconds. The instructions given on how to fix it are unlcear, since the field “Cache-Control Header” doesn’t exist anywhere in the Advanced tab settings.

    I tried debugging and consulting with your support article (https://jetpack.com/support/wp-super-cache/enabling-the-debug-mode/) where it says sometimes homepage is not cached due to POST requests. That’s not the case in my problem, since in the debug file, there’s no such error.

    Also I have a couple of pages excluded from caching and I triple checked, my homepage is not listed there. My homepage is the most important part of my website, it’s the most clicked page and I want it to have the best speed metrics possible. How can I make my homepage get cached when preloading? Also the “solution” I have found (open homepage in browser so it somehow gets cached), is it a valid thing? How can my page get cached from someone visiting since I’m using preload mode? Is it the same type of fast cache as preload or it’s the “slower” type of cache with garbage collection?

    • This topic was modified 10 months ago by kwstas778.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kwstas778

    (@kwstas778)

    As additional info. When I preload I get a result of 21 cached pages in the “Contents” tab of the plugin, with (85.89KB) space taken as shown. At this point, my wp-content > cache > supercache folder has 2.35 MB size.

    If I load my homepage in a browser, the number of cached pages on the “Contents” tabs shows as 22, in the list my homepage is included but still displays (85.89KB) as the size. Meanwhile, the wp-content > cache > supercache folder now has 2.47 MB size. Which means something got cached there.

    The question still remains, why do I need to open the page on a web browser (without logged in user), why pressing the “Preload Cache Now” button doesn’t preload that certain homepage and why the displayed size in “Contents” tab is not changing.

    Plugin Support Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Edited

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    Preloading doesn’t preload the homepage, but when the preload process finishes, it clears out old cached pages. If your site doesn’t get a lot of traffic, that may well be why you didn’t see that your homepage was cached. I just visited your site and the homepage was indeed cached and server nice and quickly.

    That cache-checker checks the browser caching of a site. If you check a WordPress site that doesn’t have WP Super Cache enabled, you’ll find that the page is not cached at all. The browser must request the page again, next time someone hits the refresh button. I put it at 3 seconds, so if someone is spamming the refresh button on their browser, their browser isn’t going to load the site for 3 seconds. If it caches for any longer, then the visitor might miss updates to the site.

    The browser might cache your homepage for 3 seconds, but since you have preload mode on, the cached file on the server for your homepage will never expire until you do the next preload. It’s two totally different caches. One on the server. One on your computer.

    Preload mode stops garbage collection. The plugin won’t delete stale cache files. It does not stop the homepage or other archive pages from caching when people visit them. People visiting them is the only way they are cached.

    How do you preload the homepage automatically? Unfortunately, the plugin can’t do that, and you’ll need to do a little coding to solve this. You could write a shell script that runs every minute through cron and checks the location of the homepage cache file, it could then use curl or wget to fetch the homepage URL. Or just fetch the homepage URL from a shell script every minute, and it will regenerate the cache within a minute of the homepage cache file being deleted.

    Thread Starter kwstas778

    (@kwstas778)

    Alright thanks for the fast replies. I was in the process of going through the ckecklist that Bruce suggested but then I saw an update on the post, reloaded the page and saw it was edited out.

    So to summarize and see if I understood this correctly.

    1. The cache-checker website, checks only for browser cache, located on each client’s machine locally and has nothing to do with out server side caching.
    2. Preload is one of the two types of server side caching you are offering with your plugin. It’s different from the other type of caching, in the sense that it preloads absolutely all pages from the website and it disables garbage collection so they don’t get deleted. The other type, generates the server cache when users visit the website, keeps them for a certain amount of time and garbage collection disposes of the old files. That is done so that for big sites with big traffic, there’s less space taken by the cache and only where needed.
    3. Preload mode by default caches everything except the homepage.
    4. What I did, preload button + load the homepage from a browser, effectively creates cache that includes everything + homepage and since it’s preload mode, it never gets deleted.
    5. Refresh preloaded cache files every?X?minutes, means that every X minutes the plugin will perform a new preload and after it finishes will delete the old files. My website is very small with infrequent changes. If I manually do a preload every time I change something, the I don’t need at all to automatically refresh my preloaded cache files using the plugin.

    Are those statements / assumptions correct?

    Thread Starter kwstas778

    (@kwstas778)

    Any further clarification on this?

    Mostly right. In “Preload Mode”, no cache files are deleted by garbage collection. Be they generated by preload, or a visitor to the website.

    Preload doesn’t cache everything. On archive pages, it will only cache the first page. It doesn’t do page 2, 3, etc.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Preload doesn’t cache homepage’ is closed to new replies.