Opencart 3.0.3.1 + Journal 3.0.46 no cache for manufacturer pages

serpent_driver

Well-Known Member
#21
already asked. but waiting for answer week or more is not right support, but I have not other choices
I you want to get support, you need to open a support ticket.
https://store.litespeedtech.com/store/clientarea.php

like I write early, the last version of LSCache for Opencart 1.3.1 added support for Journal theme Separate Mobile View for tablet
This version has no special support for Journal to detect devices. It is a universal function for mobile detection, but with different logic as Journal.

Mobile detection in LiteSpeed cache plugin for Opencart isn't synchronised with mobile_detection library. This library can differentiate between cell phones and tablets, but LiteSpeed vary cache control can't, because there is only 1 cache control define for cell phones AND tablets. That's why it doesn't work correctly.

Btw. this library for device detection is outdated. Last update was released 2 years ago and is fault tolerant. In my mind mobile detection in LiteSpeed cache plugin for OpenCart should be complete new developed.
 

AndreyPopov

Well-Known Member
#22
This version has no special support for Journal to detect devices. It is a universal function for mobile detection, but with different logic as Journal.
I'm not sure, but I think that:

[Update]mobile_detect.php add more device support, .htaccess detect more mobile http_user_agent, separate tablet cache copy from mobile cache copy according to journal theme

says something another?

and also adding this code to lscache.php

Code:
        if($detect->isTablet()){
            return 'tablet';
        } else if($detect->isMobile()){
            return 'mobile';
        } else {
            return false;
        }
isTablet() and isMobile() are Journal variables!
 

serpent_driver

Well-Known Member
#23
I'm not sure, but I think that:

Code:
        if($detect->isTablet()){
            return 'tablet';
        } else if($detect->isMobile()){
            return 'mobile';
        } else {
            return false;
        }
isTablet() and isMobile() are Journal variables!
If you don't use cache this code would work, but you use cache and if a URL is cached there is no dynamic function like PHP. That's why you need vary cache control to tell LiteSpeed which device with specific conditions is in use. LiteSpeed cache plugin for OpenCart have such vary cache control defines, but they are not the same like in library for mobile detection defined. Please read again what I already tried to explain. We are already in a loop.....

That means, open a support ticket and tell LiteSpeed support that mobile detection in cache plugin for OpenCart has a (big) dysfunction.
 

AndreyPopov

Well-Known Member
#24
problem with cache for manufacturer solved!!! by adding on Page Settings key

Code:
product/manufacturer/info
because original route query of Opencart is

Code:
index.php?route=product/manufacturer/info&manufacturer_id=7
 
#28
thanks.
combine and minify CSS are default settings in Perfomance of Journal3
I soon try disable combine and minife CSS.
may other options also can change?


but LSCache on manufacturer pages still actually interesting.
thanks.
combine and minify CSS are default settings in Perfomance of Journal3
I soon try disable combine and minife CSS.
may other options also can change?


but LSCache on manufacturer pages still actually interesting.
should i keep these options enable https://prnt.sc/Rw0CvpPrnteq ?? because i already have these options enable in coudflare https://prnt.sc/IoHpqFo2d_Ry
 

AndreyPopov

Well-Known Member
#29
should i keep these options enable
in most cases they can stay enabled.

but exist some cases that required disabled some (especially beta) features.

like for me - I disabled also JS Deffer an CSS Inline - problems when Special(discount) prices enabled.

because i already have these options enable in coudflare
this is WRONG way.

minify and combine JS or/and CSS must enabled ONLY once.
(because if enabled everywhere - Cloudfare try minify and combine already minified and combined JS/CSS by Journal)

CHOOSE where!

I choose use Journal feature
 
Last edited:

AndreyPopov

Well-Known Member
#31
Does Journal have extra functions that have manually be set for separate mobile view and Safari or is this an automatically function?
Journal3 have it's own detection algorithm that detect:
- type of device: desktop or mobile (phone or tablet)
- OS
- what browser and version
- other options
and place at html begining
HTML:
class="desktop win chrome chrome102 webkit oc30 is-admin is-guest route-common-home store-0 skin-1 desktop-header-active mobile-sticky layout-1 flexbox no-touchevents wf-vollkorn-n7-active wf-vollkorn-n4-active wf-hindmadurai-n7-active wf-hindmadurai-n4-active wf-active"
 

serpent_driver

Well-Known Member
#34
Must be used? .htaccess changes for caching, yes, but why the settings in extension? These settings are only to use mobilr_detect PHP class, but this class works different as Journal device detection, so how should that work?

Landscape and portrait doesn't matter. It is important know if mobile and tablet get different code?
 

serpent_driver

Well-Known Member
#35
Another question: If I check your page and depending on used device there is a _lscache_vary cookie set. Where does this cookie come from? LScache extension for OC?
 

AndreyPopov

Well-Known Member
#36
It is important know if mobile and tablet get different code?
can different:
- header and footer
- control elements
- menu blocks
- info blocks

in Journal3 settings you can choose what and where and HOW can showing.
journal-phone-tablet.jpg


Must be used? .htaccess changes for caching, yes, but why the settings in extension?
Another question: If I check your page and depending on used device there is a _lscache_vary cookie set. Where does this cookie come from? LScache extension for OC?
yes, LSCache plugin for OC sets coockies for _lscache_vary
 
Last edited:

AndreyPopov

Well-Known Member
#38
PHP:
protected function checkVary()
    {
        $vary = array();

        if ($this->session->data['currency'] != $this->config->get('config_currency')) {
            $vary['currency'] = $this->session->data['currency'];
        }

        if ((isset($this->session->data['language'])) && ($this->session->data['language'] != $this->config->get('config_language'))) {
            $vary['language'] = $this->session->data['language'];
        }

        
        //cookie not enabled
        if ((count($vary) == 0) && !$this->checkCookiesEnabled() ){
            return;
        }


        if ($this->customer->isLogged() && isset($this->lscache->setting['module_lscache_vary_login']) && ($this->lscache->setting['module_lscache_vary_login'] == '1')) {
            $vary['session'] = 'loggedIn';
        }

        if (isset($this->lscache->setting['module_lscache_vary_safari']) && ($this->lscache->setting['module_lscache_vary_safari'] == '1') && $this->checkSafari()) {
            $vary['browser'] = 'safari';
        }

        if (isset($this->lscache->setting['module_lscache_vary_mobile']) && ($this->lscache->setting['module_lscache_vary_mobile'] == '1') && ($device = $this->checkMobile())) {
            $vary['device'] = $device;
        }

        if ((count($vary) == 0) && (isset($_COOKIE['lsc_private']) || defined('LSC_PRIVATE'))) {
            $vary['session'] = 'loggedOut';
        }

        ksort($vary);

        $varyKey = $this->implode2($vary, ',', ':');

        //$this->log('vary:' . $varyKey, 0);
        $this->lscache->lscInstance->checkVary($varyKey);
    }
 
Top