litespeedtech / lscache-opencart

GNU General Public License v3.0
26 stars 23 forks source link

Issue - Add to cart success alert message is cached and displayed in account page, and few other irrelevant pages #28

Closed amjtn closed 1 year ago

amjtn commented 1 year ago

Hello LiteSpeed Team,

Your plugin improves the OpenCart website performance to a great extent. Just a few issues alone

Issue with Basel theme - Add to cart success alert message is cached and displayed on the account page and a few other irrelevant pages. Please refer to this attachment

LiteSpeed_Cache_Issue

OpenCart Version - 3.0.3.8 (https://github.com/opencart/opencart/tree/3.0.x.x_Maintenance) PHP Version - 8.1 LiteSpeed Plugin Used - https://github.com/litespeedtech/lscache-opencart/tree/master/3.0/upload

Kindly can you fix this Issue

Also, can you kindly add support for this theme (https://themeforest.net/item/basel-ajax-driven-opencart-theme/20199321) similar to the Journal theme

Thanks

AndreyPopovNew commented 1 year ago

same issue exist but resolved https://github.com/litespeedtech/lscache-opencart/commit/4ec23f9917ae8aa1d23a278faf319ed3f0a7d250

may be some incompatibles with php 8.xx versions

are you try disable cache for 404 option?

amjtn commented 1 year ago

Hi,

Thank you for your reply

Issue persists with both Cache 404 Pages enabled and disabled

In admin page also showing Add to cart success alert message

Can you provide any solution to solve the same

Thanks

AndreyPopovNew commented 1 year ago

what server environment are you use? LSWS (LiteSpeed Web Server) or OLS (OpenLiteSpeed)?

P.S. and remember - after any change of LSCache settings you must Purge All Caches

P.S.P.S. your theme Basel is Last Update | 21 September 2020

are you sure Basel is full compatible with PHP 8.xx?

may be try PHP 7.3 or 7.4?

amjtn commented 1 year ago

LiteSpeed web server. Not Open LiteSpeed

On Tue, May 30, 2023, 10:08 PM Andrey Popov @.***> wrote:

what server environment are use? LSWS (LiteSpeed Web Server) or OLS (OpenLiteSpeed)?

— Reply to this email directly, view it on GitHub https://github.com/litespeedtech/lscache-opencart/issues/28#issuecomment-1568745332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVSWU5NM5NLSI2LKEPCKZ3XIYPBVANCNFSM6AAAAAAX7BHTSU . You are receiving this because you authored the thread.Message ID: @.***>

AndreyPopovNew commented 1 year ago

LiteSpeed web server. Not Open LiteSpeed

are you use ESI feature?

and also enabled or disabled Ajax options for Shopcart/Wishlist/Compare?

amjtn commented 1 year ago

No ESI feature

Ajax Load Shopcart alone enabled Wishlist and compare disabled

AndreyPopovNew commented 1 year ago

ESI disabled on General tab - yes? all ESI features disabled on ESI Modules tab - yes?

what other settings?

Separate View for Logged-in Users ? on General other Separate View?

on Page Settings tab Page cache for Login ?

AndreyPopovNew commented 1 year ago

and again: Basel theme Version 1.3.1.0

you have Opencart 3.0.3.8 and PHP 8.1

amjtn commented 1 year ago

Hi,

Please find the details

a) General - LiteSpeed ESI Feature - Enabled b) General - Separate View for All Options - Enabled c) General - Ajax Load Shopcart - Enabled d) Page Settings - Page Cache ( Login ) - Enabled for all Default Page Routes e) ESI Modules - ESI Disabled for all ESI Module Routes f) Basel Theme:

1) Scenario 1:

OpenCart Version - 3.0.3.8 (https://github.com/opencart/opencart/tree/3.0.x.x_Maintenance) PHP Version - 8.1 or 7.4 Latest Basel Theme LiteSpeed Cache Disabled

Result: No Errors Reported in Log & Also NO "Add to cart success alert message displayed on the account page and a few other irrelevant pages"

2) Scenario 2:

OpenCart Version - 3.0.3.8 (https://github.com/opencart/opencart/tree/3.0.x.x_Maintenance) PHP Version - 8.1 or 7.4 Latest Basel Theme LiteSpeed Cache - Enabled with above options a) to e)

Result: No Errors Reported in Log Issue ---> "Add to cart success alert message is displayed on the account page and a few other irrelevant pages"

Thanks

AndreyPopovNew commented 1 year ago

first: b) General - Separate View for All Options - Enabled

in .htaccess uncommented LiteSpeed rewrite rules?

amjtn commented 1 year ago

LITESPEED_CACHE_START - Do not remove this line

CacheLookup on RewriteEngine On RewriteCond %{REQUEST_URI} !/admin/ [NC] ## Uncomment the following directives if you has a separate mobile view RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] RewriteRule .* - [E=Cache-Control:vary=isMobile] ## Uncomment the following directives if you has a separate Safari browser view RewriteCond %{HTTP_USER_AGENT} Safari RewriteCond %{HTTP_USER_AGENT} !Chrome RewriteCond %{HTTP_USER_AGENT} !CriOS RewriteRule .* - [E=Cache-Control:vary=isSafari] ## Uncomment the following directives only if enabled GUI Option of Separate Cache Copy for Mobile Device, "yoursite.domain" need to be changed ##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] ##RewriteCond %{HTTP_USER_AGENT} Bot ##RewriteRule .* - [CO=_lscache_vary:device\%3Amobile:yoursite.domain]

LITESPEED_CACHE_END

AndreyPopovNew commented 1 year ago

very hard to understand!!!!!!

but this rule RewriteCond %{REQUEST_URI} !/admin/ [NC] not in original plugin installation!!!!

P.S. after RewriteCond always must be RewriteRule! otherwise RewriteCond combine with next RewriteCond like logical AND

P.S.P.S. also you must check thath LiteSpeed rewrite rules placed before any other rewrite rules (like Opencart SEO) with [L] flag

amjtn commented 1 year ago

If remove below line also same issue

RewriteCond %{REQUEST_URI} !/admin/ [NC]

AndreyPopovNew commented 1 year ago

if I seen - Login page modified by your theme check route paths that used for these pages and try add these paths on URL Settings tab to Exclude URLs for logged-in users and/or Exclude URLs

amjtn commented 1 year ago

Even after excluding URLs for logged-in users also the Same issue persists

If LiteSpeed Cache is Enabled in Admin Page we are getting this alert message

image

AndreyPopovNew commented 1 year ago

post your whole .htaccess (please use code tag on editor bar)

what SEO engine you use?

amjtn commented 1 year ago

``### LITESPEED_CACHE_START - Do not remove this line

CacheLookup on RewriteEngine On #RewriteCond %{REQUEST_URI} !/admin/ [NC] ## Uncomment the following directives if you has a separate mobile view RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] RewriteRule .* - [E=Cache-Control:vary=isMobile] ## Uncomment the following directives if you has a separate Safari browser view RewriteCond %{HTTP_USER_AGENT} Safari RewriteCond %{HTTP_USER_AGENT} !Chrome RewriteCond %{HTTP_USER_AGENT} !CriOS RewriteRule .* - [E=Cache-Control:vary=isSafari] ## Uncomment the following directives only if enabled GUI Option of Separate Cache Copy for Mobile Device, "yoursite.domain" need to be changed ##RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini" [NC] ##RewriteCond %{HTTP_USER_AGENT} Bot ##RewriteRule .* - [CO=_lscache_vary:device\%3Amobile:yoursite.domain]

LITESPEED_CACHE_END

Options +FollowSymlinks

Prevent Directory listing

Options -Indexes

Deny access to all CGI, Perl, Python, Log, Ini, Text, Twig and Zip files

<FilesMatch ".(cgi|pl|py|log|ini|twig|zip)$"> Deny from all

Exclude robots.txt file alone from above block

Allow from all

RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]

RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]

RewriteRule ^google-feed$ index.php?route=extension/feed/google_base [L] RewriteRule ^facebook-feed$ index.php?route=extension/feed/facebook_feed [L] RewriteRule ^appcore/storage/(.) index.php?route=error/not_found [L] RewriteRule ^securestoragesvefiles/(.) index.php?route=error/not_found [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !..(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]) index.php?route=$1 [L,QSA]

AndreyPopovNew commented 1 year ago

who add this to you .htaccess ?!?!?!!?!?!?!

I see

  1. open tag <FilesMatch but WHERE close tag </FilesMatch>

  2. "Deny from" all and next "Allow from all" - for what ??????

  3. RewriteRule ^appcore/storage/(.) index.php?route=error/not_found [L] RewriteRule ^securestoragesvefiles/(.) index.php?route=error/not_found [L] but original is RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]

  4. RewriteCond %{REQUEST_URI} !..(ico|gif|jpg|jpeg|png|js|css) but original RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)

  5. RewriteRule ^([^?]) index.php?route=$1 [L,QSA] but original RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

who makes these changes and for what?

P.S. please use format tag CODE <> on editor tab for correct view of your post. very difficult to understand where your mistakes and where editor re-format

amjtn commented 1 year ago

Hi,

Everything is correct in .htaccess file as you have mentioned

While pasting to this editor things were removed

Kindly check this screenshot

Thanks

image

AndreyPopovNew commented 1 year ago

for LiteSpeed exist recommendation

replace Options +FollowSymlinks to Option +SymLinksIfOwnerMatch

another question

# redirect all http to https RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ?????????

and show other part of .htaccess may be it contain another rules like RewriteCond %{REQUEST_URI} !/admin/ [NC] ;)

P.S. may be continue here: https://www.litespeedtech.com/support/forum/forums/litespeed-cache-extension-for-opencart.46/

amjtn commented 1 year ago

Hi,

Changed Options +FollowSymlinks to Option +SymLinksIfOwnerMatch

And Removed Below Mentioned Lines from Htaccess

RewriteCond %{REQUEST_URI} !/admin/ [NC] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Still, Same Issue Persists

Thanks

AndreyPopovNew commented 1 year ago

until:

impossible qualification help to you

in support forum more possibilities to edit/format text and add images