Advanced Topics¶
Object Cache¶
Object caching in WordPress is a performance optimization technique that stores the results of complex or resource intensive operations in memory so that subsequent requests can quickly access them. The Object Cache is commonly used for saving the results of database queries, remote HTTP requests, and any other operations that may be especially costly.
To improve performance, the DC 37 uses a persistent object cache to store resource intensive querires. We are leveraging a Redis caching server to store the object cache.
Specifically for the Local Unions page, which contains a complex set of database queries, the object cache means that saved changes to Locals posts won't immediately be reflected on the front end of the site.
Only users with the Administrator role can flush the object cache.
To minimize issues with not seeing changes, we have created a 'hook' in code to automatically clear the object cache when you save a Local post. This means that the Local Unions page will immediately relfect your changes.