Journal3, Webp no support in Safari and LSCache

AndreyPopov

Well-Known Member
#43
now testing these rules:

Code:
RewriteCond %{HTTP_USER_AGENT} "iPad" [NC] RewriteRule .* - [E=Cache-Control:vary=isiPad]
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod" [NC] RewriteRule .* - [E=Cache-Control:vary=isiPhone]
RewriteCond %{HTTP_USER_AGENT} "GoogleBot|YandexBot|BingBot" [NC] RewriteRule .* - [E=Cache-Control:vary=isBots]
RewriteCond %{HTTP_USER_AGENT} "Mac|OS X|macOS" [NC] RewriteCond %{HTTP_USER_AGENT} "!Safari" [NC] RewriteRule .* - [E=Cache-Control:vary=isRetinaNoMac]
RewriteCond %{HTTP_USER_AGENT} "Mac|OS X|macOS" [NC] RewriteCond %{HTTP_USER_AGENT} "Safari" [NC] RewriteRule .* - [E=Cache-Control:vary=isRetinaMac]
RewriteCond %{HTTP_USER_AGENT} "Android" [NC] RewriteRule .* - [E=Cache-Control:vary=isMobile]
RewriteCond %{HTTP_USER_AGENT} "Win" [NC] RewriteRule .* - [E=Cache-Control:vary=isWin]
 

serpent_driver

Well-Known Member
#44
RewriteCond %{HTTP_USER_AGENT} "Mac|OS X|macOS" [NC] RewriteCond %{HTTP_USER_AGENT} "!Safari" [NC] RewriteRule .* - [E=Cache-Control:vary=isRetinaNoMac] RewriteCond %{HTTP_USER_AGENT} "Mac|OS X|macOS" [NC] RewriteCond %{HTTP_USER_AGENT} "Safari" [NC] RewriteRule .* - [E=Cache-Control:vary=isRetinaMac]
You seem not to understand, what you are doing?

These rules mean, if I have 4 wheels I am not a car, but if I have 4 wheels I am a car....
 

AndreyPopov

Well-Known Member
#45
You seem not to understand, what you are doing?

These rules mean, if I have 4 wheels I am not a car, but if I have 4 wheels I am a car....
Safari not support webp images. on MacOS Journal3 use high res (retina) images jpg.
but if user use Chrome on MacOS then Journal3 use high res (retina) images webp.

may be better replace !Safari for Chrome,Opera,Firefox?

Code:
RewriteCond %{HTTP_USER_AGENT} "Mac|OS X|macOS" [NC] RewriteCond %{HTTP_USER_AGENT} "Chrome|Opera|Firefox" [NC] RewriteRule .* - [E=Cache-Control:vary=isRetinaNoSafari]
 
Last edited:

serpent_driver

Well-Known Member
#46
Again, you don't know what you are doing.

This rule mean:
If I am Mac OR OS X OR macOS OR Chrome OR Opera OR Firefox then give me no Retina images. Does this make sense....?

Sorry, I am out of here.
 

AndreyPopov

Well-Known Member
#47
If I am Mac OR OS X OR macOS OR Chrome OR Opera OR Firefox then give me no Retina images. Does this make sense....?

how right write:
1. if (Mac OR OS X OR macOS) AND (Saafari)
2. (Mac OR OS X OR macOS) AND (Chrome OR Opera OR Firefox)
?????

I think OR between two RewriteCond is [OR] ?
by default means AND?
 
Last edited:

AndreyPopov

Well-Known Member
#48
some corrections:


Code:
RewriteCond %{HTTP_USER_AGENT} "iPad" [NC] RewriteRule .* - [E=Cache-Control:vary=isiPad]
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod" [NC] RewriteRule .* - [E=Cache-Control:vary=isiPhone]
RewriteCond %{HTTP_USER_AGENT} "GoogleBot|YandexBot|BingBot" [NC] RewriteRule .* - [E=Cache-Control:vary=isBots]
RewriteCond %{HTTP_USER_AGENT} "Mac" [NC] RewriteCond %{HTTP_USER_AGENT} "!Chrome|Opera|Firefox" [NC]  RewriteCond %{HTTP_USER_AGENT} "!Mobile" [NC] RewriteRule .* - [E=Cache-Control:vary=isMacSafari]
RewriteCond %{HTTP_USER_AGENT} "Android" [NC]  RewriteCond %{HTTP_USER_AGENT} "Mobile" [NC] RewriteRule .* - [E=Cache-Control:vary=isMobile]
RewriteCond %{HTTP_USER_AGENT} "Win" [NC]  RewriteCond %{HTTP_USER_AGENT} "!Mobile" [NC] RewriteRule .* - [E=Cache-Control:vary=isWin]
or may be right syntax for NOT must be:
"!(Chrome|Opera|Firefox)" ?!?!?!
 
Last edited:

AndreyPopov

Well-Known Member
#49
write rules - purge cache - test
write rules - purge cache - test
write rules - purge cache - test

not all work correct.

think, think, think ........

no need lscache for Google and others bots
no need lscache for Google Page Speed Insights
no need lscache for iPad, iPhone and Mac

what is right rules for disable lscache for these platforms?!?!?!?!?!?!

I add
Code:
RewriteCond %{HTTP_USER_AGENT} Bot|Insights|Lighthouse|iPad|iPhone|iPod|Mac [NC] RewriteRule .* - [E=Cache-Control:no-cache]
but not sure that is right :(
 

serpent_driver

Well-Known Member
#50
There is no right code!!!!!!!!!!!!!!!!!!

This task can't be solved with cache rules. What you need is a complete different solution based on Client Side Includes (Javascript). Look for a developer who is able to develop a OpenCart plugin that does the same as the current plugin for webp image, but this plugin must handle image selection on-the-fly with Client Side Includes.
 

AndreyPopov

Well-Known Member
#51
I can disable lscache for pages or routes in LSCache Control Panel

for example:
cache for Home Page enabled
lscache_page.jpg



cache for Home Page disabled
lscache_page_cache_off.jpg

and all UAs not use lscache for Home Page.


if I can sets vary for UA why I cannot sets no-cache for UA?
question: how?


I not need lscache for Googlebot, users not need lscache for Google bot.
I and users need correct indexing of pages (speed no matter)
when lscache disabled for Googlebot then Googlebot use only Journal algorithm and all pages indexed right.

I want try disable lscache for some UAs.
 
Last edited:

serpent_driver

Well-Known Member
#52
Because this settings name is "Page related" and not UA related. If you want such function you must add this function to plugin or disable UA in .htaccess.

Apache config:
RewriteCond %{HTTP_USER_AGENT} "iPad" [NC]
RewriteRule .* - [E=Cache-Control:no-cache]

Everything you want to know can be found in documentation:
https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:no-plugin-setup-guidline
https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
 

AndreyPopov

Well-Known Member
#55
You can mix them however you need it. Reed documentation about Apache Rewrite Rules
hoster provide
Code:
$_SERVER['LSWS_EDITION']    Openlitespeed 1.6.14
not Apache

on Apache guide:
Code:
RewriteCond  "%{HTTP_USER_AGENT}"  "(iPhone|Blackberry|Android)"
all in quotas

in LiteSpeed guide:
Code:
RewriteCond %{HTTP_USER_AGENT} iPad|Android [NC]
RewriteRule .* - [E=Cache-Control:vary=istablet]
no quotas

anybody know what right syntax?
if I want disable lscache for UAs in .htaccess:

- all bots
- Google Page Speed Insights
- iPad
- iPhone
- all Mac OS devices
 
Last edited:

serpent_driver

Well-Known Member
#56
Nonsense! LSWS uses Apache directive. You MUST use Apache rewrite rules. There are no other!


Apache config:
RewriteCond %{HTTP_USER_AGENT} "bot|spider|crawler|ipad|iphone|mac os|chrome-lighthouse" [NC]
RewriteRule .* - [E=Cache-Control:no-cache]
Apache config:
RewriteCond %{HTTP_USER_AGENT} "(bot|spider|crawler|ipad|iphone|mac os|chrome-lighthouse)" [NC]
RewriteRule .* - [E=Cache-Control:no-cache]
 

AndreyPopov

Well-Known Member
#60
Apache config:
RewriteCond %{HTTP_USER_AGENT} "(bot|spider|crawler|ipad|iphone|mac os|chrome-lighthouse)" [NC]
RewriteRule .* - [E=Cache-Control:no-cache]
I cannot understand how many time need that rules in .htaccess applied.
I add rules, clear all possible caches, but ...... rules not applied after that.
what control when rules from .htaccess applied?
 
Top