• Resolved szmigieldesign

    (@szmigieldesign)


    Hello,

    while testing Thrive Comments plugin I’ve encountered an error while trying to load comments. After some investigation I’ve found that there’s 403 when the plugin is trying to access /wp-json/ through:

    https://szmigieldesign.pl/wp-json/tcm/v1/comments/2643?_=1513422582563

    Opening this URL resulted in error message that one-time cookie had expired.

    I’ve checked what kind of cookies are being loaded with this request and it turned out these are:

    __cfduid
    tve_secret

    So I’ve added them to LSCache exception, together with /wp-json/ as URL exception.

    The problem with comment loading used to happen after around 24 hours from cache refresh (hence the expired cookie) and not enough time had passed to test if adding exceptions worked.

    However, right now, when I check last line of every page source code I can see that page was uncached. Timestamp changes every refresh – does it mean that the cache isn’t working?

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

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Support Cold Egg

    (@eric780217)

    Hi szmigieldesign,

    Does the plugin only works on specific theme? I can not find it in wordpress plugin.

    Do you mean optimized files are always miss? or Which page with comment always showing miss?

    For status code 403, you could try disable LSCache and see if it still happened.

    Generally LSCache exclude can not make cookie excluded works. It should enter in partial of path or file name.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Hi,

    it’s premium plugin that extends WP comments functionality – https://thrivethemes.com/comments/

    I’ve had a situation when comments didn’t load (they are being pushed through REST API, via delayed JS). Upon investigation I’ve found that they didn’t load because of certain cookie expiration (I believe it’s tve_secret). So I’ve added this cookie as an exception to LSCache.

    It’s been few days now and everything seems to be fine. I’m only worried about

    Page uncached by LiteSpeed Cache 1.6.7 on 2017-12-20 09:00:09

    In website source code. Timestamp changes whenever I refresh the page, even when I’m logged out. I used to see “Page cached” and it’s uncached now. I wonder if it’s related to this cookie exception? Does it mean that the page is being re-rendered by LSCache every time someone visits it?

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    Hello.

    Here is the problem: when you add a cookie to the Do Not Cache Cookie list, what you are really saying is “Do not cache pages that use this cookie.” So, you are correct: that timestamp indicates that the page is no longer being cached.

    Hai can take it from here with some suggestions ??

    Plugin Support Hai Zheng?

    (@hailite)

    Hi there,

    As you set that cookie to no cacheable, that makes your whole site no cacheable as that cookie doesn’t have a subfolder path restriction.

    You don’t have to set wp-json to exclude. Try to turn off REST cache.

    However, bypassing it is not the solution. We will try to reproduce that 403 and figure out the way to fix it.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    I’ve set a debugger copy on a subdomain:

    https://debug.szmigieldesign.pl/blog/unsplash-kreatywne-zdjecia-pobrania-darmo/
    https://debug.szmigieldesign.pl/blog/najlepsza-wtyczka-cache-dla-wordpress/

    The problem should appear again in approximately 24 hours. Feel free to check.

    I’ve removed the cookie exception for the main site and switched off REST caching. We’ll see if it resolves the problem or not.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    The problem is back roughly about 24 hours after the cache was built.

    You can check for example:
    https://szmigieldesign.pl/blog/iconmonstr-potwornie-bogata-galeria-darmowych-ikon/

    Comments won’t load with 403 while requesting:

    https://szmigieldesign.pl/wp-json/tcm/v1/comments/2643?_=1513860164604

    Response:
    {"code":"rest_cookie_invalid_nonce","message":"Kodem jednorazowy z ciasteczka jest nieprawid\u0142owy","data":{"status":403}}

    REST API caching is off, cookies are being cached.

    Plugin Support Hai Zheng?

    (@hailite)

    That 403 is caused by the request’s nonce expired. You shouldn’t cache that rest call. It needs to be converted to ESI.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Could you please elaborate on this matter? I’d like to pass this information along to Thrive Comments developers (I believe it’s not just a matter of switching ESI on in LSCache?).

    Plugin Support Hai Zheng?

    (@hailite)

    https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:esi_sample

    By making it ESI, it will be separate cache with separate TTL, also can be purged separately. For WP’s nonce, this is the best solution.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Awesome, thanks. I’ll pass this along.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Is there any workaround for now? Just don’t cache “/blog/*”?

    Plugin Support Hai Zheng?

    (@hailite)

    Yes that might be the only way for now.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    How can I add an exception to uncache only those pages that url contains /blog/, but not the main blog page? Ie. /blog/article1, /blog/article2, etc.

    Thread Starter szmigieldesign

    (@szmigieldesign)

    Unfortunately adding

    /blog/*

    To URL exceptions list doesn’t work.

    Plugin Support Hai Zheng?

    (@hailite)

    Do not add *

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Page uncached every single refresh’ is closed to new replies.