Skip to content

Implement caching #105

Description

@GaryJones

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
		}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions