You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
$wpdb->query( "DELETE FROM ". $wpdb->prefix ."options WHERE option_name LIKE ('_transient_".WP_PJAX_TRANIENT_PREFIX."%')" );
phpcs: WordPress.VIP.DirectDatabaseQuery: Usage of a direct database call is discouraged.
Deleting "transient%" options from database does not mean cache cleared. Other back-end can be used (ex. memcache, redis).
Cache versions can be used to invalidate cache. Version would be stored in cache and changed when clearing cache.
The text was updated successfully, but these errors were encountered:
Good point. The only way to do this must be to make a select query to get all the transient keys and then loop through them and then run delete_transient() on each one. Not very pretty, but that would allow any backend to handle this.
Or do you have any suggestions/ideas?
The page cache functionality nerver really worked very good, and should probably get a rewrite as well.
You mean something like generating keys like prefix_<version (generated random string)>_<key> and then generate a new version string when you clear the cache? For example: wp_pjax_pc-876b438o-test-page
That would be a good solution.
wp-pjax/inc/PageCache.php
Line 159 in b9f4abf
phpcs: WordPress.VIP.DirectDatabaseQuery: Usage of a direct database call is discouraged.
Deleting "transient%" options from database does not mean cache cleared. Other back-end can be used (ex. memcache, redis).
Cache versions can be used to invalidate cache. Version would be stored in cache and changed when clearing cache.
The text was updated successfully, but these errors were encountered: