Skip to content

Commit

Permalink
Improve redirect caching management (revised)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Jul 8, 2021
1 parent d509ce8 commit d34f781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Psr\Log\LoggerInterface;
use Throwable;
use Vdlp\Redirect\Classes\Contracts\CacheManagerInterface;
use Vdlp\Redirect\Classes\Contracts\PublishManagerInterface;
use Vdlp\Redirect\Models\Settings;

final class CacheManager implements CacheManagerInterface
Expand Down Expand Up @@ -76,6 +77,11 @@ public function putRedirectRules(array $redirectRules): void

public function getRedirectRules(): array
{
if (!$this->cache->tags(self::CACHE_TAG_RULES)->has('rules')) {
$publishManager = resolve(PublishManagerInterface::class);
$publishManager->publish();
}

$data = $this->cache->tags(self::CACHE_TAG_RULES)
->get('rules', []);

Expand Down
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@
- "Prevent connection exception when accessing settings in CLI mode -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.5.6"
2.5.7:
- "Improve redirect caching management -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.5.7"
2.5.8:
- "Improve redirect caching management (revised) -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.5.8"

0 comments on commit d34f781

Please sign in to comment.