Journal3, Webp no support in Safari and LSCache

serpent_driver

Well-Known Member
#82
@cafemasasandalye

LiteSpeed Enterprise has the same system requirements as OLS. If Apache runs and it runs on every server, LSWS can be executed too. You are the next one who needs essential support about what a HTTP cache is. Your and the problem of @AndreyPopov is the same. You use a theme from 3rd party, so why should LSWS support a theme with custom PHP functions that are not part of OpenCart? LScache plugin for OpenCart ist made for OpenCart, but not for Journal theme. So it is up to you to decide. LSWS with OpenCart, but without Journal theme or OpenCart with Journal theme, but without LScache.
 
#83
Well, for some reason, we cannot see a problem with themes on other platforms.

Vision matters. same wordpress but themes are different. An lscache with more settings and combinations can do this. in my opinion.
 

AndreyPopov

Well-Known Member
#85
@AndreyPopov

What do I have to do to make you understand why a cached page can't execute PHP code?
must be way to use LSCache for all views.

if disable webp support in Journal then LSCache Mobile View for Journal work (with some little exceptions).
then LSCache with webp and non-webp also can work.

in LSCache Opencart module exists Page Settings for cache:

common/home
product/product
product/category
etc.
can you help add right syntax rules to .htaccess for test


Code:
RewriteCond %{REQUEST_URI} "common/home"
????
 

AndreyPopov

Well-Known Member
#87
Values in plugin settings are different to .htaccess and can't be translated into .htaccess. To do that someone must have knowledge and experience in code of cache plugin and OpenCart.
Now only common/home enabled. because others not work correctly.

I want disable all settings in plugin and use rules in .htaccess
 

AndreyPopov

Well-Known Member
#91
developer add to new release Safari detection in php code
new option to Opencart GUI module - enable Separate View for Safari
and new rules to .htaccess
https://github.com/litespeedtech/ls.../package/lscache-opencart3.0-V2.0.0.ocmod.zip
but I use my "simple" and checked rules.


Apache config:
RewriteCond %{HTTP_USER_AGENT} "Safari|Bot" [NC]
RewriteCond %{HTTP_USER_AGENT} !Chrome [NC]
RewriteRule .* - [E=Cache-Control:vary=isSafari]
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPad" [NC]
RewriteCond %{HTTP_USER_AGENT} !CriOS [NC]
RewriteRule .* - [E=Cache-Control:vary=ismobileSafari]
RewriteCond %{HTTP_USER_AGENT} "Android|iPad|iPhone|Bot" [NC]
RewriteCond %{HTTP_USER_AGENT} "Chrome|CriOS" [NC]
RewriteRule .* - [E=Cache-Control:vary=ismobile]
now testing....
 

AndreyPopov

Well-Known Member
#97
Rebuild Cache for specific devices/browsers Did you use the feature?
not yet. because need to know correct format for User Agent for devices/browsers. developer not provide "what must be" - waiting for instructions.

but after some investigations may be finding way to solve problem:
if you use SEO urls then LScache rewrite rules in .htaccess must be before Opencart SEO rewrite rules
by default LScache add rewrite rules at the end of .htaccess.
 

AndreyPopov

Well-Known Member
#98
after three months LSCache work with Journal3 webp and non-webp. WOW!

also replace by myself Mobile_Detect algorithm to Journal3 based detection algorithm:
PHP:
    protected function checkMobile(){
     if (defined('JOURNAL3_ACTIVE')) {
         //error_log(print_r('Journal3 mobile detection algorithm used',true));
         if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE){
            return 'mobile';
        } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== FALSE){
            return 'tablet';
        } elseif ( (strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== FALSE) ){
            return 'mobile';
        } elseif ( (strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') == FALSE) ){
            return 'tablet';
        } else {
            return false;
        }
     } else {
        include_once(DIR_SYSTEM . 'library/Mobile_Detect/Mobile_Detect.php');
        $detect = new Mobile_Detect();
        if($detect->isTablet()){
            return 'tablet';
        } else if($detect->isMobile()){
            return 'mobile';
        } else {
            return false;
        }
     }
    }
 
#99
Hi @AndreyPopov,

I want to ask something. When I activate lscache in the journal theme, the mobile menu is broken. I am sending the normal and non-normal states. Do you have any thoughts on this subject?

desktop menu
1602096533263.png

correct menu (mobile menu)
1602096586036.png
 

AndreyPopov

Well-Known Member
Hi @AndreyPopov,

I want to ask something. When I activate lscache in the journal theme, the mobile menu is broken. I am sending the normal and non-normal states. Do you have any thoughts on this subject?

desktop menu


correct menu (mobile menu)

check that LSCache rules in .htaccess placed BEFORE standart Opencart SEO rules

if say in global:
if in .htaccess exist rule(s) with attribute [L] then all rules after this rule NOT WORK.
 
Top