I’m running into an issue with a website I’m managing. This is a wordpress site hosted from Bluehost’s hosting.
Every once and a while several pages on the site face a whole bunch of 409 errors. This is the main page that has been facing issues. Sometimes the files that fail to load are the css files. Which results in the page looking like this:
Sometimes the .js files are the ones which fail to load. That makes a host of other issues appear. Here’s a snapshot of the console when this happens:
A hard refresh, or clearing your browser cache usually fixes the issue. However my clients and customers don’t always know how to do this, and it shouldn’t be happening at all.
What’s super confusing is that it only happens some of the time. Although admittedly more often recently. This first started happening about two months ago.
Here’s What I’ve Tried
-
I know that a 409 error indicates a conflict in targeted resource status. But the issue only shows up sometimes, not all the time.
-
I know the paths to the resources are correct, because the pages load correctly sometimes.
-
I’ve tried disabling plugins, uninstalling plugins, no success. The issue remains.
-
I’ve tried changing the caching settings on the site. Even with no caching, the issue will occasionally pop up. I even prevented all .
css
file caching from the.httpaccess
file, no help. -
I’ve gone through and fixed all PHP errors. Issue still shows up.
-
The server isn’t showing any error messages in the server logs.
-
I’ve gone through and repaired and optimized the SQL Database, didn’t help.
-
I’ve improved the load time of the site by reducing images, only loading certain js files when needed. issue still shows up.
What’s more difficult is that it’s quite hard to test, as the issue only pops up sometimes, and other times I’m not sure if the issue is really happening, or if a customer has just cached the broken version of the site.
Any suggestions would help. I don’t have a lot of server knowledge, so I’m at a loss here.
2
Answers
Although there’s no single solution to this problem, as you’ve already tried several fixes, here are some possible causes and targeted solutions:
Strict security settings in server configurations could be a reason which might be blocking certain files sporadically. You can reach out to Bluehost support and ask if they have ModSecurity enabled or any specific firewall settings that could be causing these intermittent 409 errors.
Since hard refresh often resolves the issue, you can set Cache-Control headers to refresh more frequently or remove caching headers temporarily to see if it resolve the issue. You can also try appending ?v=1.2 to resource URLs.
WordPress can sometimes load stale resource files if their versions haven’t changed. You can try setting the version dynamically to ensure the latest version is loaded:
wp_enqueue_style( 'your-style', get_stylesheet_uri(), array(), filemtime( get_stylesheet_directory() . '/style.css' ) );
The 409 Conflict errors often indicate simultaneous updates to the same resource, possibly due to multiple requests competing to change it.
Since you’ve ruled out caching, here are additional steps to consider:
Database Locking: If two processes attempt to update the same database row simultaneously, it can cause conflicts. Check your database’s isolation level and consider implementing row-level locking if not already in place.
ETags for Conditional Requests: Implement ETags on your API endpoints. Use If-Match headers in requests to prevent updates unless the client’s ETag matches the server’s, which can help prevent conflicts when multiple clients modify the same resource.
Rate Limiting and Queueing: If there’s high traffic, consider introducing request throttling or queuing to control update requests and prevent conflicts due to overlapping operations.