Skip to content

Commit

Permalink
minor symfony#19628 [AssetMapper] Recommending Cache-Control instea…
Browse files Browse the repository at this point in the history
…d of `Expires` HTTP header (ThomasLandauer)

This PR was merged into the 6.4 branch.

Discussion
----------

[AssetMapper] Recommending `Cache-Control` instead of `Expires` HTTP header

Page: https://symfony.com/doc/6.4/frontend/asset_mapper.html#optimizing-performance

Closes symfony#19626

Commits
-------

c215366 [AssetMapper] Recommending `Cache-Control` instead of `Expires` HTTP header
  • Loading branch information
javiereguiluz committed Mar 4, 2024
2 parents 8afb402 + c215366 commit 7261f52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/asset_mapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,10 @@ which will automatically do most of these things for you:
enable `auto minify`_ to further compress your assets (e.g. removing
whitespace and comments from JavaScript and CSS files).

- **Set long-lived Expires headers**: Your web server should set long-lived
``Expires`` HTTP headers on your assets. Because the AssetMapper component includes a version
hash in the filename of each asset, you can safely set the ``Expires`` header
to a very long time in the future (e.g. 1 year). This isn't automatic in
- **Set long-lived cache expiry**: Your web server should set a long-lived
``Cache-Control`` HTTP header on your assets. Because the AssetMapper component includes a version
hash in the filename of each asset, you can safely set ``max-age``
to a very long time (e.g. 1 year). This isn't automatic in
any web server, but can be easily enabled.

Once you've done these things, you can use a tool like `Lighthouse`_ to
Expand Down

0 comments on commit 7261f52

Please sign in to comment.