It turns out this is due to SiteGround caching data, in particular its Dynamic Cache. According to their docs on Dynamic Cache, they will “… monitor whether your browser has these cookies and bypass the cache if they are present”.
One of the cookies they check against is wordpress_logged_in_, which explains the behaviour I described. When I flushed this cache manually, the new posts were fetched as desired.
It’s unclear whether this has anything to do with filemtime, perhaps it’s mere coincidence.
I tried searching for ways to programmatically purge the Dynamic Cache (on post save hooks, for example), but couldn’t find any useful information. So, the easiest solution by far was to install the SiteGround CachePress plugin, which takes care of all cache types that can be found in the SiteGround site tools.
Related Posts:
- Using Backbone with the WordPress AJAX API
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- Nonces and Cache
- Including WordPress in RESTful API
- REST API endpoint for elasticpress autosuggest
- AJAX vs Fragment Caching for W3 Total Cache [closed]
- Gutenberg – how to correctly perform ajax request on backend
- AJAX request from Chrome Extension to WordPress Website
- WP REST API route request explain
- Confused on AJAX submit form through page template
- Solve cors problem using rest api or ajax
- Is there a hook to process a backbone restful PUT request inside wordpress?
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- How to add WP API and JS featured image attachment
- how to send Ajax request in wordpress backend
- Identical wp_rest nonce returned from rest_api
- Caching-Plugins and Ajax-Page-Parts
- How do I get reusable blocks via frontend REST API?
- Is there builtin way to use protected AJAX endpoint?
- rest_no_route custom route
- Test WordPress api with postman
- How to load content from many posts on a page, only if needed
- How do I query posts by a sub value with the API?
- Cache wp-json/posts without a plugin?
- merge wp rest api query to get posts per category does not work
- Ways to load admin-ajax faster without initializing all plugins?
- Cache plugins and ajax nonce verification
- How to make a fetch() POST request to wordpress rest api?
- post values to custom post type which has advanced custom fields
- Prevent AJAX caching from plugin
- REST public POST giving 403 forbidden nginx
- Is it good practice to use REST API in wp-admin plugin page? [closed]
- 404 error custom post type rest api
- admin-ajax.php 403 errors – no caching, permissions are fine
- How to require files in a custom endpoint
- Create a post with REST API and adding a category
- Should I edit a user meta field with PUT, PATCH, or POST and WP::Editable
- How to trigger lost password email using REST API?
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- Caching for logged in user and Ajax update
- how reduce fetch/XHR response time
- Custom WP rest api endpoint only working on non https?
- How to submit a button automatically after every scheduled hours?
- How to cache json with wp-super cache
- How do I cache (core) API requests?
- AJAX request on the frontend always returns 0 if user is not admin
- Admin Notification after save_post, when ajax saving in gutenberg
- Cannot load admin-ajax.php. No access-control allow origin*
- Initialize JS with an ajax loaded ACF form
- WordPress Nonce Issue for Ajax Login and Logout
- Nonces and Ajax request to REST API and verification
- Vue.js + AJAX Shortcode
- wp_ajax action is not running
- Display sub-taxonomies based on SELECTED parent-taxonomy
- WordPress AJAX calls not detecting language properly?
- AJAX issue – Uncaught SyntaxError when processing Zip File
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- How do I set the url to make an ajax request for a html document?
- wp-admin AJAX with Fetch API is done without user
- Populating content dynamically via AJAX and Advanced Custom Fields [closed]
- Create Page With wp_insert_post() and AJAX
- Load ajax if is_home()
- wp_localize_script not working on ajax response
- SSO autologin WordPress + Ajax
- How to handle 400 status in Ajax [duplicate]
- How to process wordpress ajax call without action parameter?
- All AJAX requests return a 400 error
- Unable to successfully verify nonce
- Create custom POST Method URL
- WP Rest Api / Ajax POST not working when not logged in
- Ajax for subscibers not working
- Is it possible to determine whether a page is a page template by page_id in ajax call?
- How to stop being directed to admin.php after sending request to admin-ajax.php
- 200 return code on ‘POST /wp-admin/admin-ajax.php’ while NOT logged in
- i’m trying to get all my media query attachments via ajax in wordpress
- Next Ajax call doesn’t work
- Ajax page load without reload
- need a confirmation text to appear on email submission
- How to make pages that arent indexed for ajax applications
- Why does reCAPTCHA v3 return 0 ? In custom AJAX registration form
- admin-ajax.php 400 bad request
- How to do admin ajax request in a plugin for rest api
- WordPress Ajax Page Load to skip embedded iframe
- WordPress POST AJAX call, var_dump($_POST) NULL and AJAX response empty when inside ob_start
- Set cors header for ajax requests
- Simple AJAX code that refreshes every x seconds?
- Search function – problem with whole words
- jQuery ajax method does not return data
- Ajax is not defined
- Get posts by category via ajax
- Download doccument on server rather than clients browser
- WordPress 4.9.6 – IncludeMe & getAjax GET using wrong URL
- Create secondary Archive page format?
- Get post details with pure javascript ajax
- Weird admin-ajax.php problem
- Ajax contact form returnig 0
- Can’t update WP Editor after Ajax
- Posting to loop.php file
- Can’t have two simultaneous charts using Apex Charts
- Rest API nonce is being cached