diff --git a/Controller/AssetCacheKeyFilter.php b/Controller/AssetCacheKeyFilter.php new file mode 100644 index 00000000..0ad13144 --- /dev/null +++ b/Controller/AssetCacheKeyFilter.php @@ -0,0 +1,50 @@ +cacheKey = $cacheKey; + } + + /** + * {@inheritdoc} + */ + public function hash() + { + return $this->cacheKey; + } + + public function filterLoad(AssetInterface $asset) + { + } + + public function filterDump(AssetInterface $asset) + { + } +} diff --git a/Controller/AsseticController.php b/Controller/AsseticController.php index a3af5243..1475f52c 100644 --- a/Controller/AsseticController.php +++ b/Controller/AsseticController.php @@ -85,7 +85,9 @@ public function render(Request $request, $name, $pos = null) return $response; } - $response->setContent($this->cachifyAsset($asset)->dump()); + $etagCacheKeyFilter = new AssetCacheKeyFilter($response->getEtag()); + + $response->setContent($this->cachifyAsset($asset)->dump($etagCacheKeyFilter)); return $response; }