• Resolved sevenkader

    (@sevenkader)


    Is there a way to serve the cache only from the preload? Meaning, I don’t actually want to collect cache from users and serve that cache, I just want to user the cache that the preloaded gets. That will solves all problems related to cookies/login/cart problems while allowing you to serve non-cookied cache to everyone, whether they’re logged in or not. So basically is there a way to disabled cache collection from users and just serve the cache that the preloader gets

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

    (@vmarko)

    Hello @sevenkader

    Thank you for reaching out and I am happy to assist you with this.
    W3 Total Cache does not collect cache from users. The Page is cached once visited, and it’s the same if the page is visited by some visitor or with the cache preload.

    It’s not recommended to cache pages for logged-in users. This is a general rule and if you are doing this you need to understand that some specific user data may be cached (even with preload) because the cache is cleared if something was updated etc.
    You can add cookies to exclusion in Performance>Page Cache>Advanced>Rejected cookies:

    You can set up a Cache preload in Performance>Page Cache>Cache Preload, using the sitemap and triggering the preload by page visit.
    You can also use WP-CLI and call
    wp w3-total-cache pgcache_prime

    I hope this helps!
    Thanks!

    Thread Starter sevenkader

    (@sevenkader)

    I think you misunderstood me I apologize,

    Lets go with the statement you made about “The Page is cached once visited, and it’s the same if the page is visited by some visitor or with the cache preload.”

    The last part of the sentence “or with cache preload”, how can I use only that cache preload visit, and disable the cached visit of a user? In other words you said the page is cached once the preload basically visits it, or if a user visits it, how can I have it preloaded only when the preload visits it and not the user, do you understand what I mean? I don’t want the page to cache when a user visits it, I only want a page to cache once the preloader visits it (there’s a preloader that preloads the page and primes it even before a visitor arrives, that way the page is ready even before someone visits it right? How can I have the pages cached using ONLY that, and not cached by actual human visits. I only want the Preloader’s visit to be cached, not the users visit)

    • This reply was modified 2 years, 11 months ago by sevenkader.
    • This reply was modified 2 years, 11 months ago by sevenkader.
    • This reply was modified 2 years, 11 months ago by sevenkader.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sevenkader

    As I’ve mentioned in the previous post, You can set up a Cache preload in Performance>Page Cache>Cache Preload, using the sitemap and triggering the preload by page visit.
    You can also disable the wp_cron and create the manual server cron to visit the page every 10 mins.
    If you want to bypass the corn call or page visits you can use wp-cli:
    wp w3-total-cache pgcache_prime
    Thanks!

    Thread Starter sevenkader

    (@sevenkader)

    I understand. I just want to clear something up, with this method, if a visitor visits the page, will they still be cached? I don’t want users to be cached. I already know how to preload, my main thing here that I’m trying to explain is that I don’t want the users themselves to be cached.(I want them to be served the preloaded cache, but not their cache to be taken, since their cache will include cookies) The method you explained to me, will it achieve this? In other words I want all users to be served cache, but I don’t want any of them to be cached, I want the cache to come directly from the Preload. (Again this isn’t a question of how to set up preloading), if you don’t understand what I mean/understand what I’m asking you don’t have to answer this I feel I’ve taken enough of your time, I apologize.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @sevenkader

    Thank you for your feedback.
    The users are not cached. This is not how caching works. The pages are cached being cached and it’s not user-based.
    I understand what you are asking but this is simply not how caching works. This is why you should avoid caching for logged-in users.
    For example, you enable the cache preload and the entire website is cached. Once the process is complete, it starts from the beginning, now depending on which user is visiting the page, if logged in, the cached page may include some log-in information.
    So, if a user logs in, and at the top of the page there is information about the account of the user: Welcome John Doe, this may be cached and not because the page is cached for that user or because of any cookie, but because In the moment of caching, this is what was displayed in HTML.
    If you do not have this kind of information displayed when a user logs in, you can cache all pages for all user roles.

    I hope this answers your question.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Serve Cache from Preload only’ is closed to new replies.