How to config LsCache for prestashop

#1
I enable " Check Public Cache > Yes" then install and enable Prestashop cache module in website, finally add this code to .htaccess

Code:
<IfModule LiteSpeed>
    CacheEnable public
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^GET|HEAD|PURGE$
    RewriteCond %{HTTP_HOST} ^DOMAIN.COM [NC]
    RewriteCond %{REQUEST_URI} !ADMINADDRESS|404|address|authentication|best-sales|cart|contact|discount|guest-tracking|history|identity|order|password|products-comparison|search|account|friend|login|logout|addresses|contact-us|order-history|my-account|order-confirmation|order-follow|quick-order|credit-slip|password-recovery [NC]
    RewriteCond %{HTTP_COOKIE} !logged|cart [NC]
    RewriteCond %{QUERY_STRING} !nocache [NC]
    RewriteRule .* - [E=Cache-Control:max-age=1800]
</IfModule>
is it true the things that I do? or needed to do something else?
 

Pong

Well-Known Member
Staff member
#4
you refer to a wrong article, https://www.litespeedtech.com/suppo...temage:configuration:user-defined_cache_rules is for LiteMage cache for Magento, not lscache for prestashop.

LiteSpeed cache only cache dynamic cache for PHP and doesn't cache static files by design as it should. Static files can set browser cache, which is different than litespeed full page cache.

All configurable options should be within litespeed cache plugin for prestshop, if any certain thing you are looking for not there, you can join slack on golitespeed and talk to our developer Lauren for a possible feature request.
 
Last edited:
#5
how can I define excluding for any address or URL such as 404 page?
I insert this line in .htaccess but not work:
Code:
    RewriteCond %{REQUEST_URI} !ADMINADDRESS|404|address|authentication|best-sales|cart|contact|discount|guest-tracking|history|identity|order|password|products-comparison|search|account|friend|login|logout|addresses|contact-us|order-history|my-account|order-confirmation|order-follow|quick-order|credit-slip|password-recovery [NC]
 

Pong

Well-Known Member
Staff member
#6
It won't work for sure. cache will be handled by the plugin and need some configuration/code change on Prestashop PHP side. Please don't mix your rewrite rules with plugin. Anything not mentioned in the wiki may be invalid way, for example, "enable " Check Public Cache > Yes" " is incorrect. all rules you placed in .htacces should be removed, etc

To exclude some URLs from cache, you can consider https://www.litespeedtech.com/suppo...lscps:configurations#user-defined_cache_rules. Any further questions, You can join our Slack channel GoLiteSpeed: https://join.slack.com/t/golitespee...BlNGZkY2E3Y2E4MjIzNmNmZmU0ZjIyNWM1ZmNmMWRlOTk and ask more question to our developer directly.
 
Last edited:
Top