-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting at 3.16, mobile cache is activated by default #214
Comments
hello, with wp rocket pushing "mobile cache" with all the benefits of "Optimize critical images" and "reduce unused css" (which benefits both desktop and mobile total file size) I wonder what the current best caching option is for powerful dedicated hosting? Have you already decided whether you will improve rocket-nginx (if even possible) to support mobile cache from wp rocket? |
I have Cloudflare in front of Nginx which actually sends me I see WpRocket already has compatibility with CloudFlare APO which I am currently using and have enabled device specific cache there also (as it is recommended by WPRocket) Cloudflare uses regex defined here https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type |
we also use cloudflare (pro) together with wprocket |
I have made a direct fix in my config file and it seems to pick proper mobile caches with help of CloudFlare Added below checks & commented out existing mobile cache checks |
awesome thank you |
Based on Cloudflare documentation, these rules that are incomplete and not perfect could be implemented: I do not have enough data to know if it covers 99.9% of all requests or if it 85%. Implementing Mobile Detection perfectly would be nearly impossible using Nginx's scripting language. |
I just released version 3.1.0 beta where mobile detection is supported using Cloudflare's regex rules. This is not perfect as Nginx's scripting does not allow all functions needed for full detection but it should cover the same devices as Cloudflare. If you can test and let me know if it works well or not, it would be appreciated. https://github.com/SatelliteWP/rocket-nginx/releases/tag/v3.1.0-beta |
Awesome, thank you! I'll let you know as soon as we implemented it! |
Desktop works well for us, thank you. What I coudn't test was mobile (as I don't have the right tools on my phone). |
@maximejobin thank you for this update! Mobile detection works well. I have tested a few Android and iOS user agents (using desktop firefox Tools -> Web Developer- > Responsive Design View). Of course it is not able to detect all mobile browsers. For example at the Android Section at https://deviceatlas.com/blog/mobile-browser-user-agent-strings you can see that there are some Android Browsers that will not be detected currently. The only identifiable string in their user agent would be their browser short name. You probably don't want to go down the rabbit hole of detecting mobile browser variants and mobile devices.
? |
The detection regex is in a configuration variable. Therefore, you can edit it if you want! If I cannot detect that it is indeed a mobile, then it is a desktop. Not serving any file would not make sense to me. |
Starting at 3.16, mobile cache is activated by default on new installations following the removal of the Cache tab.
This means two cache files are generated (desktop and mobile) and we need to be able to know if the visitor comes from mobile or not.
This could be tricky as identifying the device is not easy with Ngnix's scripting language.
Could be based on the JSON from Mobile Detect.
The text was updated successfully, but these errors were encountered: