stored data for selective purge on cache fill using prepared statement and after checking if db is read-write