SatelliteWP / rocket-nginx

Rocket-Nginx is a Nginx configuration that makes WP-Rocket even faster by serving static pages directly without loading WordPress or PHP.
MIT License
579 stars 129 forks source link

X-Rocket-Nginx-Reason: Specific mobile cache activated #125

Closed gutitti closed 4 years ago

gutitti commented 4 years ago

header result :

X-Rocket-Nginx-Serving-Static: No
X-Rocket-Nginx-Reason: Specific mobile cache activated
X-Rocket-Nginx-File: /home/nginx/domains/domain.com/public/wp-content/cache/wp-rocket/domain.com///index-https.html_gzip

i try using at location / {

try_files $uri $uri/ /index.php?q=$uri&$args;

or

try_files $uri $uri/ /index.php?$args;

or

try_files "/wp-content/cache/wp-rocket/$host${uri}$is_args$args/index-https.html_gzip" $uri $uri/ /index.php$is_args$args;

But header result still X-Rocket-Nginx-Serving-Static: No

when i using cat /home/nginx/domains/domain.com/public/wp-content/cache/wp-rocket/domain.com///index-https.html file is lived and cached in folder /wp-content/cache/wp-rocket/

gutitti commented 4 years ago

Fixed : only must disable mobile cache But how will it support mobile seperate cache in future ? because my themes has mobile conditional when mobile detected will hide some feature ( example : sidebar and footer navigation )

maximejobin commented 4 years ago

As per the documentation:

Specific mobile cache activated: If you activated specific cache (one for mobile and one for desktop) in WP-Rocket, HTML files (pages, posts, ...) won't be served directly because Rocket-Nginx cannot know if the request was made by mobile or desktop device.

You have to disable "Mobile caching" in WP Rocket.

But how will it support mobile seperate cache in future ? because my themes has mobile conditional when mobile detected will hide some feature ( example : sidebar and footer navigation )

It won't. There is no way for Rocket-Nginx to know if the call comes from a Desktop or a Mobile. For that reason, Rocket-Nginx cannot make the right decision to serve the right file and lets WP Rocket handle that.