My server responding late (around 5 min) to prestashop webservice due to litespeed cache

#1
Hello,

I am using litespeed cache on my server. My website is on Prestashop e-commerce, I am using prestashop webservice where API is reflecting data around 5 min late due to litespeed cache. When I remove the litespeed from prestahop .htaccess file its working file.

Please let me know if there any rewrite configuration in my .htaccess file,

Thanks
 

NiteWave

Administrator
#2
I'm new to Prestashop, maybe our other staff as well.
can you provide more info so we know what exact issue is ?
for example, what's current rewrite rules in .htaccess which relating to Prestashop ?
 
#3
I'm new to Prestashop, maybe our other staff as well.
can you provide more info so we know what exact issue is ?
for example, what's current rewrite rules in .htaccess which relating to Prestashop ?
thanks for the reply I requested to do this please check the link,

https://www.a2hosting.com/kb/a2-hos...g-caching-for-prestashop-on-turbo-web-hosting

current rewrite rule is :

<IfModule LiteSpeed>
CacheEnable public
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET|HEAD|PURGE$
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{REQUEST_URI} !admin123|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=900]
</IfModule>



I think

[E=Cache-Control:max-age=900]

this line is creating some issues for Prestashop webservice.

Thanks,
 

mistwang

LiteSpeed Staff
#4
You can add the URL for the web service to the rewrite rule to exclude that from being cached. Add to this one.
RewriteCond %{REQUEST_URI} !admin123|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]
 

mistwang

LiteSpeed Staff
#6
The cache problem is likely caused by your default cache policy. the rewrite rule use max-age=900, which is 15 minutes, so your 5 minutes cache delay is likely caused by cache configuration with max-age=300.
You should turn off cache globally, and let rewrite rule to turn on cache for you.
 
#7
The cache problem is likely caused by your default cache policy. the rewrite rule use max-age=900, which is 15 minutes, so your 5 minutes cache delay is likely caused by cache configuration with max-age=300.
You should turn off cache globally, and let rewrite rule to turn on cache for you.
I did not measure the exact time but its working after 5 min.

When I delete these Rewrite condition from my .htaccess file , every thing is working fine.

Thanks,
 
Top