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

NGinx not loading cached pages with query parameters #182

Closed fidoboy closed 2 years ago

fidoboy commented 2 years ago

I've added my query parameters in WP Rocket and also into the rocket nginx ini to properly saving and retrieving URLs with query parameters. I've verified that they are being stored into the cache folder structure, so the writing to disk part is working as expected, and folder names starts with # character replacing the ? symbol.

However, when loading that pages into the browser I can see in the headers that the rocket nginx is returning always MISS, so it's not working as expected and it's not retrieving the file from disk.

So my question is simple: why?

It's a bug? How can I debug it to know why rocket nginx is failing?

Thanks in advance for any tip, indication or suggestion to solve this problem.

Regards,

fidoboy commented 2 years ago

May be that problem is with params order? I can see a created folder with this name: #orderby=ASC&series=big-troubles-and-so but the URL is like this: https://www.mydomain.com/well-page/?series=big-troubles-and-so&orderby=ASC. So WP Cache is not naming the folder with same order than it appear on the URL.

In both WP Rocket and rocket-nginx I've provided 'orderby' and 'series' as key params to be cached (not bypassed) but as I've said before, I get the header with "MISS" status when examining it in my browser. Reloading the page many times and always the header returns the "MISS" status.

So if rocket-nginx is looking for the folder with same order than it appears on the sample URL it will fail. May be there is a bug in rocket-nginx? What do you think @maximejobin ?

maximejobin commented 2 years ago

Yes, params order is important for WP Rocket.

It is not a bug but a limitation from WP Rocket. Rocket-Nginx simply follows the logic that comes from WP Rocket.

There is nothing else that can be done with Rocket-Nginx for this issue, unfortunately.