Offloader Creating 404s
-
First of all, nice plugin. It’s worked pretty well in my initial tests. But I’m running into a few issues…
After offloading all of my media to CloudFlare R2 I ran a crawler and found numerous 404s on the site after offloading. Upon inspection I found that the plugin is rewriting URLs on the website for files that don’t actually exist on CloudFlare R2.
Upon further troubleshooting I found that this occurs when image derivatives aren’t registered in the
_wp_attachment_metadata. Here is an example:Original File:
/2015/06/Example.jpgDerivatives:
/2015/06/Example-300×300.jpg
/2015/06/Example-800×600.jpg
/2015/06/Example-1024×768.jpgFor this example, if the 1024×768 size is not registered in the wp_attachment_metadata, the plugin will not upload the file to CloudFlare R2. But it will still proceed to update the URLs in the post where the ‘/2015/06/Example-1024×768.jpg’ was referenced. This results in a 404 now. The physical file exists locally but the plugin doesn’t upload it to CloudFlare R2 even though it’s changing the URL in the content.
Since the plugin isn’t checking rather the image derivatives are uploaded, it’s creating a lot of problems on the site. Luckily I’m doing this on a test environment.
This website has been around for a long time and the image size is not currently used by the activated theme. It was most likely something used long ago. It’s hard to say why the sizes aren’t registered in the wp_attachment_metadata but they wouldn’t result in 404’s if the offloader checked to make sure they existed in R2 before rewriting the URLs.
Ultimately the goal is to remove all locally stored files and store everything in the bucket. So this would also create a bit of a problem with the end goal. I’m trying to figure out the best options for scenarios like this and rather or not your plugin could work for us. I’m sure I’ll run into these same scenarios on many other websites.
I’m also running into issues with images that use the GenerateBlocks plugin. These images do seem to get uploaded to CloudFlare R2 but seem to be served locally… I haven’t fully had time to troubleshoot this but if you’re aware of any issues or lack of support your offloader would have with plugins like this, it would be helpful to understand.
Thanks,
Ben
You must be logged in to reply to this topic.