From a12980ea6783a4593b9ce0e590859f848787be02 Mon Sep 17 00:00:00 2001 From: Thomas Sigdestad Date: Tue, 19 Dec 2023 15:31:37 +0100 Subject: [PATCH] more polishing --- docs/page-templates.adoc | 2 +- docs/static-assets.adoc | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/page-templates.adoc b/docs/page-templates.adoc index 8d3f186..22730b3 100644 --- a/docs/page-templates.adoc +++ b/docs/page-templates.adoc @@ -66,4 +66,4 @@ You've just learned about page templates, which is a way to reuse a page across TIP: If you want to control the rendering of certain pages without using page templates, check out https://developer.enonic.com/docs/xp/stable/framework/mappings[controller mappings^]. -Next up, \ No newline at end of file +Next up, let's see how to <>, using the built-in asset service. \ No newline at end of file diff --git a/docs/static-assets.adoc b/docs/static-assets.adoc index ce30826..5f8d07e 100644 --- a/docs/static-assets.adoc +++ b/docs/static-assets.adoc @@ -28,10 +28,11 @@ If you're using `dark mode`, the result will look something like this: image::css.png["Countries page in dark mode after adding the css", width=1024px] -=== Perfect cache -In production, every asset will include cache headers that allow CDNs and browsers to cache it - and never need to download it again. +== Perfect cache +When running Enonic XP in production, every asset will include cache headers that let proxies/CDNs and browsers cache it - without ever having to download it again. + +*How does it work?* -How does it work? The generated asset URL will contain a prefix based on a signature of the files in the app. The signature will change with every new version of the app. The `portal.assetUrl()` function uses this signature when generating the URL, ensuring that clients always get the most recent version. NOTE: When running in dev mode (like you do now), cache headers are deactivated