diff --git a/README.md b/README.md index 577c37d..3ca0239 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A Momento API Token is required. You can generate one using the [Momento Console ## Installation -Add the module with `composer require 'momentohq/drupal-cache:v0.2.0'`. You may need to edit your `composer.json` to set `minimum-stability` to `dev`. +Add the module with `composer require 'momentohq/drupal-cache:v0.2.1'`. You may need to edit your `composer.json` to set `minimum-stability` to `dev`. Enable the module in your Drupal administrator interface. diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index e850675..138d5fe 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -67,19 +67,13 @@ private function isValid($item) { // see if there's an invalidation timestamp in the cache $getResponse = $this->client->get($this->tagsCacheName, $tag); if ($getResponse->asHit()) { - $this->getLogger('momento_cache_tag_validation')->debug( - "FOUND INVALIDATION RECORD FOR $tag in bin $this->bin" - ); $invalidatedTags[$tag] = (float)$getResponse->asHit()->valueString(); - $this->getLogger('momento_cache_tag_validation')->debug( - "INVALIDATED: " . implode(', ', array_keys($invalidatedTags)) - ); if ($invalidatedTags[$tag] > $item->created) { $isValid = FALSE; break; } } elseif ($getResponse->asError()) { - $this->getLogger('momento_cache_tag_validation')->error( + $this->getLogger('momento_cache')->error( "Error fetching invalidated tag record for $tag: " . $getResponse->asError()->message() ); } @@ -155,7 +149,7 @@ public function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANEN if ($setResponse->asError()) { $this->getLogger('momento_cache')->error("SET response error for bin $this->bin: " . $setResponse->asError()->message()); } else { - $this->getLogger('momento_cache_tags')->debug( + $this->getLogger('momento_cache')->debug( "SET $this->bin:$cid with tags: " . implode(', ', $item->tags) ); } @@ -249,19 +243,12 @@ public function invalidateTags(array $tags) { $tags = array_unique($tags); $invalidateTime = round(microtime(TRUE), 3); - $this->getLogger('momento_cache_tag_validation')->debug( - "INVALIDATE_TAGS in bin $this->bin with tags: " . implode(', ', $tags) - ); foreach ($tags as $tag) { $setResponse = $this->client->set($this->tagsCacheName, $tag, $invalidateTime, $this->MAX_TTL); if ($setResponse->asError()) { - $this->getLogger('momento_cache_tag_validation')->error( + $this->getLogger('momento_cache')->error( "INVALIDATE_TAGS response error $tag: " . $setResponse->asError()->message() ); - } else { - $this->getLogger('momento_cache_tag_validation')->debug( - "INVALIDATE_TAGS invalidated $tag in $this->bin at $invalidateTime" - ); } } }