Skip to content

Commit

Permalink
Merge pull request #625 from devcorrelator/master
Browse files Browse the repository at this point in the history
Add ability to configure Asset Cache time.
  • Loading branch information
markstory authored Aug 24, 2018
2 parents 8a089bc + fbbbcd8 commit b95f711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/app.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
*/
'Asset' => [
//'timestamp' => true,
// 'cacheTime' => '+1 year'
],

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public function middleware($middlewareQueue)
->add(ErrorHandlerMiddleware::class)

// Handle plugin/theme assets like CakePHP normally does.
->add(AssetMiddleware::class)
->add(new AssetMiddleware([
'cacheTime' => Configure::read('Asset.cacheTime')
]))

// Add routing middleware.
// Routes collection cache enabled by default, to disable route caching
Expand Down

0 comments on commit b95f711

Please sign in to comment.