diff --git a/.env.dist b/.env.dist index c1852bb1..723bc26a 100644 --- a/.env.dist +++ b/.env.dist @@ -12,6 +12,7 @@ FILESYSTEM_DISK=local QUEUE_CONNECTION=sync SESSION_DRIVER=redis SESSION_LIFETIME=120 +RESPONSE_CACHE_ENABLED=false REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 056d55ea..d0127398 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -32,3 +32,5 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: kmikus12/bar-assistant-server:latest, kmikus12/bar-assistant-server:${{github.ref_name}} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c87650..88d970be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v0.5.2 +- Add response caching, disabled by default +- Cache docker image steps in GH actions + +# v0.5.1 +- Add cascading deletes for some foreign keys + # v0.5.0 - Use redis for session and cache - Automatically select some ingredients when running the application for the first time diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index b061561e..64ea1570 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -43,6 +43,7 @@ class Kernel extends HttpKernel \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 'throttle:api', \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Spatie\ResponseCache\Middlewares\CacheResponse::class, ], ]; @@ -65,5 +66,6 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'cacheResponse' => \Spatie\ResponseCache\Middlewares\CacheResponse::class, + 'doNotCacheResponse' => \Spatie\ResponseCache\Middlewares\DoNotCacheResponse::class, ]; } diff --git a/config/bar-assistant.php b/config/bar-assistant.php index b4544ade..dfc3f9c7 100644 --- a/config/bar-assistant.php +++ b/config/bar-assistant.php @@ -11,7 +11,7 @@ | */ - 'version' => 'v0.5.1', + 'version' => 'v0.5.2', /* |-------------------------------------------------------------------------- diff --git a/config/responsecache.php b/config/responsecache.php index 331c24eb..2da759f6 100644 --- a/config/responsecache.php +++ b/config/responsecache.php @@ -4,7 +4,7 @@ /* * Determine if the response cache middleware should be enabled. */ - 'enabled' => env('RESPONSE_CACHE_ENABLED', true), + 'enabled' => env('RESPONSE_CACHE_ENABLED', false), /* * The given class will determinate if a request should be cached. The