302 errors increasing
-
Have started to notice the occurrence of 302 status involving Autotomize.
https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_c3983f435e3ea8a1111ddd6d62537df7.css Linked to redirect...https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_fallback.css
Please advise
The page I need help with: [log in to see the link]
-
that happens when HTML in a page cache contains references to autoptimized files that were removed when the AO cache got cleared. purge any page cache you might have and the redirect should not happen any more.
hope this helps,
frankThanks for responding. I flushed the page cache in each instance and did another scan with Screaming Frog and the 302 issue still exists
Afraid I have no idea what Screaming Frog is and how it collects its data, but when looking at the homepage now I don’t see any 302’s on autoptimized files?

Screaming Frog is a site analyser. As you dont have it, here is a screen dump showing the 302 errors
https://www.trapbarn.com/wp-content/uploads/2022/11/303-status-scaled.jpgit looks like https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_09c3fe3933a286f799f738f66670f548.css is still redirecting, but https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_09c3fe3933a286f799f738f66670f548.css?SQdfqsf=dsfq (the same URL with a parameter to bypass caches) is working, so it seems like there’s a caching layer (CDN) which has the 302 cached somehow, so you’ll have to purge that cache (I *think* the CDN one).
The pages that are involved are:-
https://www.trapbarn.com/fix-jamming/ https://www.trapbarn.com/trapping-weasels/ https://www.trapbarn.com/tunnel-tips/ https://www.trapbarn.com/cookies/ https://www.trapbarn.com/fenn-trap-faqs/ https://www.trapbarn.com/how-to-set-your-fenn/ https://www.trapbarn.com/cookie-policy-2/ https://www.trapbarn.com/shop-fenn-at-trap-barn/They get redirected individually and a typical redirect is seen at…
https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_57c5963ebe621bb33947d94cf61399d1.cssTested 4 of those and 3 did not have a redirect (tunnel-tips/, fenn-trap-faqs/ and how-to-set-your-fenn/), but https://www.trapbarn.com/shop-fenn-at-trap-barn/ indeed did for https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_57c5963ebe621bb33947d94cf61399d1.css but https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_57c5963ebe621bb33947d94cf61399d1.css?qsdfsqdf=sqdfq (same URL but with a cache-busting parameter) does not meaning the CDN cache will need to get purged to ensure the redirect response (HTTP 302) is removed from the CDN cache.
A bit surprising to have that cached on CDN-level, I would generally advise against CDN’s caching non-HTTP 200 reponses, maybe that’s an option you can untick somewhere?
We don’t have a CDN configured.
It gets weirder. I thought I would deactivate Autotize and the clear all caches. After that, only two 302 erors were show,
Next, I reactivated Autoptimize and this resulted in sixteen 404 errors!
Things are improving.
It turns out that most of the 494’s were for FAQ entries, All these 404’s the disappeared when I visited each of these. And they came u OK. RElief!It also reduced the 302 to one page only, viz
https://www.trapbarn.com/get-rid-of-mink/What do you reckon was behind it?
well on
get-rid-of-mink
(with a querystring added to the URL to bust the cache, at first I saw a version of the page without AO) there indeed is https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_d0a01a387091cdfd1ce14d8b6b389d14.css still redirecting to the fallback but https://www.trapbarn.com/wp-content/cache/autoptimize/css/autoptimize_d0a01a387091cdfd1ce14d8b6b389d14.css?sqdfqsdf=qsdfq (again just a simple cache busting querystring added) does not.
although you might not know you have a CDN, your host certainly does seem to have one (Stackpath) based on the HTTP response headers;

What seems to have happened is the Autoptimize cache got cleared (either by you after making a change to the AO config or by a theme/ plugin hooking into AO’s API) without the page cache being cleared, resulting in browsers getting references to non-existing autoptimized CSS files, triggering the 404 fallback logic and then the fallback responses (HTTP 302) were cached at host/ cdn level (which explains why the fallback is shown unless a cache-busting parameter is added to the URL).
Or the short version; too much caching by your host 🙂
You certainly seem to know what’s going on!
That said, what, if anything should I tell my host to do?
It doesnt seem, at present, to be a big issue because any visitors to the site seem to get the page displayed OK in the end.
What do you reckon I do, if anything, if it stays the same without getting more widespread?if this becomes a bigger problem; ask your host to ensure static files are purged from all levels (local cache/ cdn cache) and more importantly that non HTTP 200 responses are not cached (a redirect should never be cached in my opinion).
Many thanks. I really appreciate your expertise and support.
you’re welcome, feel free to leave a review of the plugin and support here! 🙂
The topic ‘302 errors increasing’ is closed to new replies.