Zabbix Monitoring x-litespeed-cache:miss Magento 2 Store

#1
Good morning,
we use zabbix as monitoring software and monitor among other things the number of articles on the category pages from magento 2 stores.
This worked very well and we got all the pages from cache.
Since I activated "enable custom vary" with option "yes and enforce vary checking on first visit" it doesn't work anymore because the monitoring system can't get the pages out of the cache.
Everthing works as usual on desktop and mobile devices.
Is there a way to assign the desktop cache vary to the IP from monitoring system?

I would be glad to get a reply to that question.
Thanks a lot!

Best regards
 

serpent_driver

Well-Known Member
#2
Is there a way to assign the desktop cache vary to the IP from monitoring system?
No, it isn't. Since there is a difference in the term "vary". The HTTP vary header is primarily intended to tell the browser that there is different content depending on the device used. However, this cache vary header has nothing to do with LiteSpeed cache vary. Therefore it is not possible to explain to your tracking software which content is currently being used. You therefore need another tracking software like Matomo.
 
#3
No, it isn't. Since there is a difference in the term "vary". The HTTP vary header is primarily intended to tell the browser that there is different content depending on the device used. However, this cache vary header has nothing to do with LiteSpeed cache vary. Therefore it is not possible to explain to your tracking software which content is currently being used. You therefore need another tracking software like Matomo.
Many thanks for the quick reply!
I didn't know the difference before I got your answer.
My idea was to create a rewritecondition for the IP of the monitoring server and set for example vary=isbot like condition of httpagent and assign vary=ismobil.
 

serpent_driver

Well-Known Member
#4
You still don't understand the difference between the "vary" response header and the E=Cache-Control:vary directive. If you want to create a different cache copy depending on the device, then you have to define the appropriate conditions for the rewrite rule. It would then look something like this:

Code:
RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile]
But that's just one example.
 
#5
Yes, I already use a similiar definition like yours.
I use this definition on every litespeed server to force a copy for mobile devices:

Code:
    RewriteCond %{HTTP_USER_AGENT} "android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iP(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|(Android.+Mobile)|NOKIA|SymbianOS|N900|BlackBerry"
    RewriteRule .* - [E=Cache-Control:vary=ismobile]
My idea was a definition like this for my monitoring (just an example):

Code:
RewriteCond %{REMOTE_ADDR} !^123\.231\.45\.67
RewriteRule .* - [E=Cache-Control:vary=isbot]
The idea behind it would be that this IP receives a cache copy and can access this cache copy after the first call.
Maybe I still have an error in reasoning...

Do you know a source where the difference is explained in detail?

I am really grateful to you for the help!
 

serpent_driver

Well-Known Member
#6
There is no special source for it, because it is just a rewrite rule that follows Apache's way to define it, so look at Apache documentation.
 
Top