@@ -631,27 +631,25 @@ To make your AssetMapper-powered site fly, there are a few things you need to
631
631
do. If you want to take a shortcut, you can use a service like `Cloudflare `_,
632
632
which will automatically do most of these things for you:
633
633
634
- - **Use HTTP/2 **: Your web server ** must ** be running HTTP/2 (or HTTP/3) so the
634
+ - **Use HTTP/2 **: Your web server should be running HTTP/2 (or HTTP/3) so the
635
635
browser can download assets in parallel. HTTP/2 is automatically enabled in Caddy
636
- and can be activated in Nginx and Apache. Or, proxy your site through a
637
- service like Cloudflare, which will automatically enable HTTP/2 for you.
636
+ and can be activated in Nginx and Apache.
638
637
639
638
- **Compress your assets **: Your web server should compress (e.g. using gzip)
640
639
your assets (JavaScript, CSS, images) before sending them to the browser. This
641
640
is automatically enabled in Caddy and can be activated in Nginx and Apache.
642
- Or, proxy your site through a service like Cloudflare, which will
643
- automatically compress your assets for you. In Cloudflare, you can also
641
+ In Cloudflare, you can also
644
642
enable `auto minify `_ to further compress your assets (e.g. removing
645
643
whitespace and comments from JavaScript and CSS files).
646
644
647
645
- **Set long-lived Expires headers **: Your web server should set long-lived
648
- Expires headers on your assets. Because the AssetMapper component includes a version
649
- hash in the filename of each asset, you can safely set the Expires header
646
+ `` Expires `` HTTP headers on your assets. Because the AssetMapper component includes a version
647
+ hash in the filename of each asset, you can safely set the `` Expires `` header
650
648
to a very long time in the future (e.g. 1 year). This isn't automatic in
651
649
any web server, but can be easily enabled.
652
650
653
651
Once you've done these things, you can use a tool like `Lighthouse `_ to
654
- validate the performance of your site!
652
+ check the performance of your site.
655
653
656
654
.. _performance-preloading :
657
655
0 commit comments