So, i ran a few more tests, and still didn’t find a solution.
First of all, i’ve increased the number of strings to redirect:
It helps a little to stabilise the server, but didn’t solve the problem at all.
Then i tried to put the rules to hide the headers at the beginning of the server directive. Maybe it was being bypassed, i don’t know:
But nop, no effects.
Let the server burn
Then i decided to clear ALL caches, and let the server burn fo almost an hour, at 3am. Maybe the cache needed to be built, right? Nop, no results.
But i was able to notice one thing, using
These are requests that were hitting my server. Cache purged, Page Rule disabled, and APO enabled (with WP Plugin).
Take a look at the red number. Look how many requests to the same urls. Even if there was a single person trying to access the same page, at the same time, all around the world, still it should not hit my server 124 times (and growing rapidly).
I mean, the first hit on each CF’s datacenter would generate a cache, and all the subsequents requests should be cached, right?
So i opened all of those URLs in incognito mode, and got a cache hit. I thought: ok, now i know those urls are cached in Brazil’s datacenter fore sure. The hits should stop, or at least slow down.
NOP, it didn’t. It kept growing and growing after i took this screenshot.
Also, there really wasn’t many users online in that google translator link. And the logs doesn’t show any unusual user-agents:
GET /283220/como-funciona-o-google-tradutor/ HTTP/1.1" 200 22276 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36”
GET /283220/como-funciona-o-google-tradutor/ HTTP/1.1" 200 22276 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36”
“GET /283220/como-funciona-o-google-tradutor/ HTTP/1.1” 200 22276 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Edg/85.0.564.70”
“GET /283220/como-funciona-o-google-tradutor/ HTTP/1.1” 200 22276 “-” “Mozilla/5.0 (Linux; Android 9; SM-J600GT) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36”
So, how is it possible for this requests to keep hitting my server, when those pages are already cached? Makes no sense, even if cloudflare had 200 diferent datacenters, what are the odds?
Last but not least: HEAD + 304 == very important
I don’t think APO is responding to HEAD requests, nor sending status 304 based on the last-modified. But it should. Take a look at this graph from GSC:
Look how much additional data was transferred, since APO was enabled.
The before graph was my OLD setup, using a Page Rule with only one hour of Edge Cache TTL. Much more efficient, even with a shorter cache.
So that’s it, i’m about to give up on APO. In theory is supposed to be the perfect cache setup. But it really needs to mature a lot, yet.