Issue with WordPress database caching
-
I am having an issue that when I call
wp_insert_post()
the cache for my CPT is not cleared. So when I callget_posts()
the newly inserted post is missing.After some help from Facebook, I found the
cache_results
andupdate_post_meta_cache
settings in the query arguments and that fixes my problem, but it’s not particularly efficient since I only do about 12 to 15 inserts a day.What I am wondering is if calling
wp_cache_flush()
after each insert would be more efficient… or if there is a way to specifically target the one CPT to flush its cache after each insert.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Issue with WordPress database caching’ is closed to new replies.