I had an issue with WordPress content not being updated immediately; a quick search of the boards suggest a few others have as well, so I thought I would post a solution here.
ISSUE
The front page of WordPress is not updated when a post is added. Additionally, edits to existing posts may not be updated. This happens in both regular and incognito modes on all browsers, except if logged in to WordPress, and appears to be cache related.
SETTINGS
The publisher may presume that all steps are in place to ensure WordPress is updated via clearing front page and article cache whenever content is added/edited.
- Ezoic plugin installed and active with 'Purge Home' enabled under CDN Settings tab.
- All Siteground caching disabled as far as possible
- No additional caching plugins or theme mods in place
SOLUTION
The issue is that by default, SiteGround keeps one caching technology enabled by default and it cannot be switched off via the customer's web interface.
It's called "Dynamic Cache" and is designed to reduce database queries. It can be cleared manually from the web interface but it can't be switched off.
There are two solutions:
- Install the SiteGround Optimiser plugin and switch it off that way.
- Add the following code to the top level .htaccess file (you may need shell access for this, it may be accessible via the web File Manager)
# Disable SG Dynamic Cache
<IfModule mod_headers.c>
Header set Cache-Control "private"
</IfModule>
# END disable SG Dynamic Cache
Option 1 is the easiest but adds 'bloat' to your installation and you may inadvertently add more caching options back in.
Option 2 requires a little editing of a server file but is a permanent fix.
*** CAUTION: Please exercise due diligence before adding this code to your file. Check with an expert to ensure it is safe to add. It is only intended for SiteGround users and no guarantee it will work on any other host.
I can confirm I have had no issues since adding this code. Front page updates immediately upon adding new content.