• Resolved truqmedia

    (@truqmedia)


    Hey there, I am currently testing LS cache on a staging subdomain.

    I’ve adjusted the LS cache “Woocommerce” settings so that when I make a purchase, the product page gets purged. This is happening for simple products, which is wonderful.

    My problem is that I have many product bundles (many of which contain said product) and those pages don’t get purged. This results in the customer seeing inaccurate stock values on bundles.

    Is there a way to purge Product bundles that include a product when that product’s stock status changes? Alternatively (but less than ideal) is there a way to exclude product bundles from cache entirely?

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know what option you chose in wooc tab ?

    there are 4 options , which one you set ?

    best regards,

    Thread Starter truqmedia

    (@truqmedia)

    Apologies, I should have included that information. Currently I’m on “Always purge both product and categories on changes to the quantity or stock status”.

    I should also mention that the Product bundles are almost entirely comprised of product variations.

    So just to be clear: when purchasing Bundle A, which is comprised of product 1 (with predetermined quantities of variations I, II and III), the cache for the single product page of product 1 gets purged (which is desired and expected), but not the cache for Bundle A.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know how this “bundling” come from ? is that Wooc Native feature or you get it by some other plugin ?

    Best regards,

    Thread Starter truqmedia

    (@truqmedia)

    It’s from Woocommerce Product Bundles (SomewhereWarm). I could have sworn I read Litespeed was compatible with it but upon checking just now it seems I misread.

    I have been reading about Litespeed’s API and cache tags since first talking to you and it seems that would be the solution. My bundles all have the same product category. So I can easily pinpoint them and assign a tag to them upon saving the bundle, with LiteSpeed_Cache_API::tag_add.

    My problem is that the tag disappears as soon as the cached page is generated. I would need it to persist, so that I could tell Litespeed to purge products containing that tag when stock changes. Is there a way to add tags at the moment when the cached page is generated?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Usually , you will see

    x-litespeed-tag: tag1 , tag2 , tag3 , tag4

    alone with

    x-litespeed-cache: miss

    by that means :

    when you see “miss” , you will see “tag” header

    when you see “x-litespeed-cache: hit” , the tag header will be “hidden” , but the tag should still be there.

    if you see tag is being added by API , but when you call to purge that tag, it doesn’t , then it probably a server-side bug.

    You can use debug log to check what tag(s) has been added to certain page , then try to purge by tag, and see if it works.

    Best regards,

    Thread Starter truqmedia

    (@truqmedia)

    Oohhh, I see. I thought the fact that I couldn’t see it meant it was gone.

    They will still disappear after a purge though right? So I would have to call the purge and then reassign the tag right after?

    Thread Starter truqmedia

    (@truqmedia)

    Ah never mind. Of course, if I set the tag to be assigned when the page is visited, then it will always be there when it gets cached after the purge.

    One question though, you say “You can use debug log to check what tag(s) has been added to certain page”. Debug shows me what tags were purged but I can’t see which ones were added. Where do I find this?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Please check this wiki

    In log , you will see an entry like this

    06/24/18 20:55:54.411 [1.2.3.4:31844 1 mIO] X-LiteSpeed-Tag: 87f1_URL.6666cd76f96956469e7be39d750cc7d9,87f1_F,87f1_Po.24,87f1_PGS,87f1_

    Best regards,

    Thread Starter truqmedia

    (@truqmedia)

    I’m not seeing that anywhere in the log, which is strange because the tags are in the response headers the first time I load the page. I do see the purges though. “X-LiteSpeed-Purge:”

    I must be doing something wrong.

    edit: Alright I found it. I didn’t realize the basic/advanced debug had different files.

    • This reply was modified 5 years, 1 month ago by truqmedia.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Is everything good ?

    Best regards,

    Thread Starter truqmedia

    (@truqmedia)

    Yes, sorry about the late reply. Everything is working ??

    Plugin Support qtwrk

    (@qtwrk)

    Glad to know !

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Stock issue with Product bundles’ is closed to new replies.