Support » Plugin: LiteSpeed Cache » “recently viewed products” not working

  • Resolved trmkr

    (@trmkr)


    Hello,

    After enabling caching, “recently viewed products” is not working. I tried load JS deferred OFF and Deferred but it didn’t work. Can you help please?

    Thank you
    Regards

    Report number: FSXEYAMZ
    Report date: 10/19/2021 09:36:10

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

    (@qtwrk)

    Hi,

    please try , add this at top of your .htaccess , purge all and check again

    RewriteRule .* - [E=Cache-Vary:woocommerce_recently_viewed]

    Best regards,

    Thread Starter trmkr

    (@trmkr)

    Hello,

    Thank you very much!

    Is it ok if I add like this?

    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule \.litespeed_conf\.dat - [F,L]
    
    ### marker NOCACHE COOKIES start ###
    RewriteRule .* - [E=Cache-Vary:woocommerce_recently_viewed]
    RewriteCond %{HTTP_COOKIE} yith_wcwl_session_\*
    RewriteRule .* - [E=Cache-Control:no-cache]
    ### marker NOCACHE COOKIES end ###

    Also, this line didn’t work. Is it normal?

    RewriteCond %{HTTP_COOKIE} yith_wcwl_session_\*|woocommerce_recently_viewed

    Regards

    • This reply was modified 8 months, 2 weeks ago by trmkr.
    • This reply was modified 8 months, 2 weeks ago by trmkr.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    no , add it BEFORE the line # BEGIN LSCACHE

    RewriteCond %{HTTP_COOKIE} yith_wcwl_session_\*|woocommerce_recently_viewed

    did you add these cookie name in Cache -> Exclude -> Do not cache cookie list ?

    Best regards,

    Thread Starter trmkr

    (@trmkr)

    Hello,

    Thank you again!

    Yes I added these cookie names in Cache -> Exclude -> Do not cache cookie list but it didn’t solve the problem. Therefore, I removed [woocommerce_recently_viewed] cookie from this list.

    Regards.

    Thread Starter trmkr

    (@trmkr)

    Hi again,

    This line solved the problem. Thank you very much!

    RewriteRule .* - [E=Cache-Vary:woocommerce_recently_viewed]

    Regards

    Thread Starter trmkr

    (@trmkr)

    Hello,

    After adding the above line at top of the .htaccess, cache is recreated every time I visit the product pages. Can you help please?

    Thank you
    Regards

    For example, homepage cache status:

    <!-- Page generated by LiteSpeed Cache 4.4.3 on 2021-10-22 15:14:01 -->
    
    <!-- Page generated by LiteSpeed Cache 4.4.3 on 2021-10-22 15:14:41 -->
    
    <!-- Page generated by LiteSpeed Cache 4.4.3 on 2021-10-22 15:31:00 -->
    
    <!-- Page generated by LiteSpeed Cache 4.4.3 on 2021-10-22 16:09:21 -->
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    if you view some product , it has to create new cache with new product to be shown in the “recent viewed product”

    otherwise you won’t see the newly added product into “recent review” list

    if that recent viewed product was added by shortcode or widget , you can try to make it ESI block , which should be more efficient way to handle it

    Best regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘“recently viewed products” not working’ is closed to new replies.