• Resolved Anuj Subedi

    (@h1dd3nsn1p3r)


    Hi Folks,

    I have an EDD (Easy Digital Downloads) mini cart in the header. It displays cart items if they are saved in the edd_items_in_cart cookie. But, since the page is being cached, it displays a “Your Cart is empty” message.

    I hope you already get my problem.

    What I have done so far:

    – Excluded edd_items_in_cart cookie in LsCache > Cache > Exclude cookie. Also, added a .htaaccess rule.
    – Tried generating unix timestamp in the EDD cart container.

    `// get current date, time with seconds
    $current_date = date(‘Y-m-d H:i:s’);
    // convert current date to unix timestamp
    $current_date_unix = strtotime($current_date);`

    – Added ajax="true" & reload="1" attributes.
    – Even tried adding an attribute data-no-lazy="1" which is actually for excluding images.

    Since the page is being cached, nothing above worked. I am NOT using ESI as I am in OpenLiteSpeed & Cloudflare CDN.

    Please let me know how can I exclude cache for Mini Cart? I have also opened this issue here.

    Thank you in advance.`

    • This topic was modified 3 years, 1 month ago by Anuj Subedi. Reason: Fixed formatting

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

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

    (@qtwrk)

    Hi,

    try add this into top of your .htaccess

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

    then purge all

    best regards,

    Thread Starter Anuj Subedi

    (@h1dd3nsn1p3r)

    Hello @qtwrk

    I think this rule did work (Still testing). I have now added on the top of .htaccess file https://ibb.co/3BmQD3X

    As far I know .htaccess file is overwritten by the LsCache plugin whenever the settings are tweaked. Also, it is overwritten by other plugins like WordFence.

    Is there a way to add this .htaccess rule RewriteRule .* - [E=Cache-Vary:edd_items_in_cart] on the virtual host file of OpenLiteSpeed Server?

    Regards,
    Anuj

    Plugin Support qtwrk

    (@qtwrk)

    it should be OLS webadmin console -> vhost -> rewrite tab

    Thread Starter Anuj Subedi

    (@h1dd3nsn1p3r)

    Is this the same syntax RewriteRule .* - [E=Cache-Vary:edd_items_in_cart] that goes in OLS > VHost > Rewrite?

    Plugin Support qtwrk

    (@qtwrk)

    yes

    you may need to add RewrirteEngine On before this line

    Thread Starter Anuj Subedi

    (@h1dd3nsn1p3r)

    Thanks a lot, @qtwrk ?? I’ll definitely try.

    I am marking this topic as resolved.

    Again, Thank you very much.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude cache for EDD minicart’ is closed to new replies.