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?
- WordPress REST API FormData: Form Not Submitted When No Files Attached
- admin-ajax.php won’t load without logging as admin- JSON Parse error: Unexpected EOF
- register_rest_route to send via ajax as guest results to 403
- PHP “php://input” vs $_POST
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE
- Show spinner GIF during an $http request in AngularJS?
- Refresh HTML Page in Browser Automatically on Timer – Every 15 Min
- JavaScript implementation of Gzip
- jQuery: Performing synchronous AJAX requests
- ASP.NET MVC controller actions that return JSON or partial html
- jQuery’s .on() method combined with the submit event
- Ajax takes 10x as long as it should/could
- How to check if I am in admin-ajax.php?
- Best way to end WordPress ajax request and why?
- How to load wp_editor() through AJAX/jQuery
- How to cache json with wp-super cache
- Load minimum WordPress environment
- Why use wp_send_json() over echo json_encode()?
- Why use admin-ajax.php and how does it work?
- How to get a unique nonce for each Ajax request?
- Open a Thickbox with content trough AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Why not register shortcodes if is_admin dashboard?
- WordPress AJAX with Axios
- Why is die() used at the end of function that handles an Ajax request?
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Making my AJAX powered WordPress Crawlable
- Is there a JavaScript API? How to access public and private data in JS?
- Get Previous & Next posts by Post ID
- failed to load wp-admin/admin-ajax.php
- How do I cache (core) API requests?
- Using Ajax with a Class file
- Ajax in a settings page (update_option is undefined)
- How to pass data parameter to ajax action function handler
- WordPress Ajax Data Security
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- gettext does not translate when called in ajax
- Execute one AJAX request after another AJAX request finished
- Ajax and autocomplete
- How to add to cart via AJAX Woocommerce [closed]
- SSL breaks customizer: page isn’t returned from ajax
- Why is a 500 error generated by admin-ajax.php not going into the Apache error log?
- Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
- How to HTML5 FormData Ajax
- admin-ajax.php vs Custom Page Template for Ajax Requests
- How to override WP_DEBUG for Ajax responses?
- Stop admin-ajax?
- redirect out of wp-admin, without losing admin-ajax.php
- Call to undefined function add_action()
- Is it safe to assume that a nonce may be validated more than once?
- When adding a custom REST endpoint, where do you put the endpoint function, and where do you put the function registration call?
- Multiple ajax nonce requests
- Get posts with ajax