Opencart 3.0.3.1 + Journal 3.0.46 separate Mobile View and Google Search Console

AndreyPopov

Well-Known Member
#1
Opencart 3.0.3.1
Journal 3.0.46
LiteSpeed cache 1.3.1

https://www.priazha-shop.com

in .htaccess uncommented

Code:
### LITESPEED_CACHE_START - Do not remove this line
<IfModule LiteSpeed>
CacheLookup on
## Uncomment the following directives if you has a separate mobile view
RewriteEngine On
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]
</IfModule>
### LITESPEED_CACHE_END

in Opencart LiteSpeed cache module installed, enabled and separate Mobile View sets.


on desktop show full version view
on mobile show mobile version

but..... Google Search Console says: bad Mobility usability

why!?!?!?!?!



30.04.2020 first attempt use LiteSpeed cache, but foget uncomment Rules in .htaccess
04.05.2020 disable LiteSpeed cache and wait until errors in Google Search Console gone
14.05.2020 again enable LiteSpeed cache, uncomment Rules in .htaccess and again errors in Google Search Console
 

Attachments

Last edited:

serpent_driver

Well-Known Member
#2
You only have to uncomment it if your app has PHP function to detect kind of device. As I know Opencart has no such device detection. Mobile View in OpenCart will be handled by media queries and not by device detection.

Btw. disable Pagespeed. Pagespeed doesn't work correctly and forces too much load. You don't get advantage using Pagespeed.
 

serpent_driver

Well-Known Member
#4
Possible reasons:

- Journal 3 and LiteSpeed cache plugin may have differently working logic to detect devices
- You have Pagespeed active. Pagespeed has no function to detect devices
- You have still inline styles enabled
- You missunderstand what a algorithm for device detection is.
- wrong styled theme -> that is the most likely reason for your problem. https://search.google.com/test/mobile-friendly?id=Q5uc0-eO9SAEo6sqPxlYiA Contact the webdesigner of your theme to correct it. This is not caused by LiteSpeed!!!
 

AndreyPopov

Well-Known Member
#5
until LiteSpeed cache enabled I have not problem with Google Search Console Mobile Usability.

I undestand that "Journal 3 and LiteSpeed cache plugin may have differently working logic to detect devices " - but question how correct this?
 

serpent_driver

Well-Known Member
#6
Either Journal 3 logic or LiteSpeed logic (code) must be changed, but disable Pagespeed, disable inline styles, disable mobile view and try mobile friendly test again. I can't believe that Journal 3 has a device detection. Journal 3 uses media queries for different screen sizes/resolutions, but that isn't a algorithm to detect devices. That is pure Stylesheet.

Check https://www.speedtemplate.de This page has an algorithm to detect devices, so every kind of device gets its own code. This is quite different at your site.

Btw. something is very strange on your server. If I check response header nginx webserver is running instead of LiteSpeed. Have you installed LiteSpeed webserver or was it pre-installed?
 

AndreyPopov

Well-Known Member
#7
I can't believe that Journal 3 has a device detection. Journal 3 uses media queries for different screen sizes/resolutions, but that isn't a algorithm to detect devices. That is pure Stylesheet.
Yes, Journal detect device screen resolution.
but if not enable on LiteSpeed settings separate Mobile View than Mobile View can be seen on Large Desktop version or vise versa Desktop View on mobile device.


but disable Pagespeed, disable inline styles
CSS inline already disabled in Journal settings, cache cleared.

how disable Pagespeed? I find only how disable for Nginx and/or Apache, but only hoster can do these.



Btw. something is very strange on your server. If I check response header nginx webserver is running instead of LiteSpeed. Have you installed LiteSpeed webserver or was it pre-installed?
some strange problem with PHP oh hosting.
15.05.2020 hoster upgrade PHP to version 7.2.31 and at 00:00 my site only show only home page. all other links show 404 error.
yesterday I solve by disable/enable OPcache in Admin Panel. site work whole day.
but today at 00:00 again only home page answer, all other links show 404 error
disable/enable OPcache not help.an that's why return default by hoster Apache.
now step by step return LiteSpeed. right now want enable LiteSpeed cache again.
 
Last edited:

AndreyPopov

Well-Known Member
#11

Attachments

Last edited:
#15
Hello @AndreyPopov

I'm trying to leave litespeed 100% in my shop, Opencart 2.3 + Jorunal latest version.

I think it's 99% complete :)

I have a problem detecting devices, I have selected banners for desktop and others for mobile.

It turns out that in some situations the desktop banner is loaded on mobile.

I turned on separate cache for mobile, and the problem continued.

I turned on cahce for Safari, and it worked on Safari, but when connecting to iPhone through Chrome, it continues to show desktop banners.

Another test: On my cell phone (Android) Via chrome, always the first load of the store, I see the desktop banners, after the first load, it loads the mobile banners.


Can you help me? Thanks!
 

Attachments

AndreyPopov

Well-Known Member
#16
I turned on cahce for Safari
turn separate cache for Safari only if you have webp images, because Safari not supported webp format.
Journal3 (like me) include webp converter, Juornal2 - no.

disable separate cache for Safari and leave in .htaccess only:

Code:
### LITESPEED_CACHE_START - Do not remove this line
<IfModule LiteSpeed>
CacheLookup on
## Uncomment the following directives if you has a separate mobile view
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "Android|iPhone|iPad" [NC]
RewriteRule .* - [E=Cache-Control:vary=ismobile]
</IfModule>
### LITESPEED_CACHE_END
 
#17
turn separate cache for Safari only if you have webp images, because Safari not supported webp format.
Journal3 (like me) include webp converter, Juornal2 - no.

disable separate cache for Safari and leave in .htaccess only:

Code:
### LITESPEED_CACHE_START - Do not remove this line
<IfModule LiteSpeed>
CacheLookup on
## Uncomment the following directives if you has a separate mobile view
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "Android|iPhone|iPad" [NC]
RewriteRule .* - [E=Cache-Control:vary=ismobile]
</IfModule>
### LITESPEED_CACHE_END


At this time I ended up making a change, reading other questions from Opencart users on the forum.

The administrators advised to increase the list of devices on htacces, and decided, can you leave it like this?

everything seems to work, and detection is no longer failing, both on android and ios.

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop| iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\os)?|phone|p(ixi|re)\/| plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\(ce|phone)|xda|xiino" [NC]
RewriteRule .* - [E=Cache-Control:vary=ismobile]
 

AndreyPopov

Well-Known Member
#18
Code:
RewriteCond %{HTTP_USER_AGENT} "Android|iPhone|iPad" [NC]
is enough for detecting mobile devices.


all smartphones and tablets contains "Android" in UA.
all iPhones conraians "iPhone" in UA.
all iPads conraians "iPad" in UA

UAs above coverage 99% of present mobile devices ;) .

all others strings NOT NEEDED!

Windows Mobile or iPod now not used for Internet surfing.
 
Top