I have a plugin with a bulk updater that loops through all images. Currently the bulk updater runs in the browser and makes ajax calls. I am keeping track of the progress by storing a progress indicator (a number) in the database.
During each run, the previous progress indicator is read, incremented by one, and saved back to the database.
On servers with object caching enabled, the data that is being read is the cached value and not the one saved in the database. This causes issues sometimes where the same image keeps on getting updated instead of progressing to the next.
Any idea how to solve this? Please suggest a better solution too, if there is one.
Currently I am using
get_optionto read the saved number and
update_optionto write the updated number back into the database.
Side note, I found this thread with some ideas, but none of them seems to be comprehensive – https://wordpress.stackexchange.com/questions/100040/can-i-force-get-option-to-go-back-to-the-db-instead-of-cache
Thanks in advance for your time.
- You must be logged in to reply to this topic.