• Resolved thefitrv

    (@thefitrv)


    I think I’ve got this figured out (been working fine for several days now), just wanted to make you aware of a strange behavior with AOs fallback file and Cloudflare. Also, maybe a sanity check on my thinking is in order.

    Basically, I had an error where the pagination on my site would stop working after a few days. But only (strangely) on *some* category pages. It always cleared up after I would refresh all the caches (Divi, AO, WP-SuperCache, NGINX, Cloudflare). Eventually isolated the problem to Cloudflare and AO and .js files (which Cloudflare caches).

    What seemed to be happening is, when a file was not found in cache, AOs fallback mechanism would redirect it to the fallback file. In my case, it seemed that the fallback file was from the homepage, which did *not* have the pagination logic, so the page more or less appeared normal except for pagination not working. Since the redirect from AO was a 301 (permanent) instead of a 302 (temporary), I think Cloudflare would follow the redirect, and then cache the result and serve that .js to visitors instead of the original file. It seemed to not check again until otherwise forced to (updated post, etc.).

    Does that make sense? I’ve turned off AO’s fallback, and the problem has stayed away for a week now (whereas previously, it would start to show up as caches timed out). For the time being, I’ve got some logic in .htaccess to serve up 410s instead of 404s on missing AO files without a valid referrer (because any request for an AO file without a valid referrer seems to be from a bot). I have not tried changing the AO fallback logic to serve 302s instead, but perhaps with Cloudflare, that might be a better behavior?

    Interested in your thoughts. (Because it’s possible I’m completely off my rocker…)

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Strange error with fallback files and Cloudflare’ is closed to new replies.