Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement caching #105

Open
GaryJones opened this issue Aug 10, 2024 · 0 comments
Open

Implement caching #105

GaryJones opened this issue Aug 10, 2024 · 0 comments

Comments

@GaryJones
Copy link
Contributor

Creating an issue with a copy of code that will be cleaned up, since it would need to be tested and re-added. Pulled from the Zoninator class.

		// TODO: Caching needs to be testing properly before being implemented!
		function get_zone_cache_key( $zone, $args = array() ) {
			return '';

			$meta_key = $this->get_zone_meta_key( $zone );
			$hash     = md5( serialize( $args ) );
			return $meta_key . $hash;
		}

		function get_zone_posts_from_cache( $zone, $args = array() ) {
			return false; // TODO: implement

			$meta_key  = $this->get_zone_meta_key( $zone );
			$cache_key = $this->get_zone_cache_key( $zone, $args );
			if ( $posts = wp_cache_get( $cache_key, $meta_key ) ) {
				return $posts;
			}
			return false;
		}

		function add_zone_posts_to_cache( $posts, $zone, $args = array() ) {
			return; // TODO: implement

			$meta_key  = $this->get_zone_meta_key( $zone );
			$cache_key = $this->get_zone_cache_key( $zone, $args );
			wp_cache_set( $cache_key, $posts, $meta_key );
		}

		function _empty_zone_posts_cache( $meta_key ) {
			return; // TODO: implement
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant