• Hey guys,

    The home page of this website wasn’t caching.

    The debug log said it was working fine, like this:

    `
    05:53:44 18946 / Renamed temp supercache file to /httpdocs/wp-content/cache/supercache/www……com.au/index-https.html
    05:53:44 18946 / Renamed temp supercache gz file to /httpdocs/wp-content/cache/supercache/www…………com.au/index-https.html.gz
    `

    But the cache folder was always empty, and it was always regenerating a cache file with a new timestamp.

    So something was deleting the index* files between the time they were generated and the next request.

    There is a wp-json javascript call from the home page (and other pages). It was triggering wp_cache_ob_callback which seemed to remove everything in the cache folder.

    `
    07:03:31 20917 /wp-json/facetwp/v1/refresh Not caching POST request.
    07:03:31 20917 /wp-json/facetwp/v1/refresh wp_cache_ob_callback clearing rebuilt files in /httpdocs/wp-content/cache/supercache/www……com.au/
    `

    No idea what’s going on really, but I took a sledgehammer approach and commented out the unlink in wp_cache_ob_callback so that my home page would cache.

    Is there any way to figure out why a POST to /wp-json/facetwp/v1/refresh is killing the home page cache?

    Cheers,
    Dave

  • The topic ‘Ajax WP JSON API request kills home page cache’ is closed to new replies.