Skip to content

Commit

Permalink
more polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sigdestad committed Dec 19, 2023
1 parent 4690d2d commit a12980e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/page-templates.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Next up, let's see how to <<static-assets#, add and serve static assets>>, using the built-in asset service.
7 changes: 4 additions & 3 deletions docs/static-assets.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a12980e

Please sign in to comment.