Skip to content

Commit

Permalink
Add image cache, add response cache
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Nov 22, 2022
1 parent a254b21 commit 4a06b29
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
];

Expand All @@ -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,
];
}
2 changes: 1 addition & 1 deletion config/responsecache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a06b29

Please sign in to comment.