Skip to content

Commit

Permalink
add capability to disable cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3n committed Jan 25, 2022
1 parent b7afbba commit e6312d2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 32 deletions.
59 changes: 29 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/EventSubscriber/ViewCacheSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ private function cachable(KernelEvent $event): bool
}

$request = $event->getRequest();
if ($request->query->get(SemartApiSkeleton::DISABLE_CACHE_QUERY_STRING)) {
return false;
}

if ($request->isMethod(Request::METHOD_GET)) {
return true;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/SemartApiSkeleton.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ final class SemartApiSkeleton

final public const STATIC_CACHE_HEADER = 'X-Semart-Content-ID';

final public const DISABLE_CACHE_QUERY_STRING = 'dc';

final public const CODENAME = 'Dodol Duren';

final public const VERSION = '5.8.4';
final public const VERSION = '5.8.5';

final public const VERSION_MAYOR = 50000;

final public const VERSION_MINOR = 800;

final public const VERSION_PATCH = 4;
final public const VERSION_PATCH = 5;

public static function getVersionNumber(): int
{
Expand Down

0 comments on commit e6312d2

Please sign in to comment.