Most assets in your library, including custom components, stylesheets, and scripts, use two stages. The working copy is the version you and your colleagues edit, and only staff can see it. Publishing copies that working copy to a numbered published version, which is the version your sites load for visitors.
Saving edits and publishing them are separate actions for these asset types. File assets, such as uploaded images and PDFs, are the exception. A file asset publishes itself as soon as you create or replace it. See Upload and Replace a File Asset for how that works.
Why Publishing Is a Separate Step
Publishing is separate so you can work on a stylesheet or custom component without changing the live site. When you are ready, you publish it so visitors can see the change.
Rhythm records who published each version, when they published it, and any comment they added. That gives you a history of changes over time. If you revert an asset to an earlier saved copy of its record, history entries for anything published after that point no longer appear, even though those versions were published.
Each Published Version Keeps Its Own Address
Each time you publish, Rhythm writes the new version to its own address and keeps it there while the asset exists. It does not overwrite or remove earlier published versions.
That helps existing pages keep working. If a page already points to an earlier version of a stylesheet or script, it can still load that version after you publish a newer one, because the earlier file remains at the address the page expects.
Published stylesheets and scripts are ordinary files that a browser can load directly. Templates, custom components, and HTML assets publish as structured data for whatever reads them. Before you publish a stylesheet or script, make sure its content pane is not empty, because publishing empty content does not produce a reliable result.
Warning
Every published asset is public. Anyone with an asset's published address can open it, whether or not they are signed in to your portal. There is currently no way to publish an asset privately, including a document meant only for members. Do not publish a file you want to restrict to a specific audience; keep it out of the asset library's published store instead.
The Asset Map
Your sites do not look for the newest published version of every asset each time a page loads. Instead, Rhythm keeps an asset map that tells each site where to find the current published version of its templates, components, stylesheets, scripts, and files.
A few things follow from how the asset map works:
- An image placed by its asset is swapped to the published copy after the page has already started rendering, so the page may briefly request the original address it was built with before the swap happens.
- Deleting an asset can leave a stale entry in the map. If a page or site setting still links to a deleted asset, the browser may keep requesting a file that no longer exists until the map is corrected.
- A site's linked stylesheets and scripts load once per browser session. If you publish a new version of a stylesheet or script while a visitor is already browsing your site, they may not see the change until their next visit.
If your sites still load an outdated stylesheet, script, or image after you publish a change, rebuilding the asset map is usually the right repair.
Templates Are an Exception
Templates do not use this publish cycle in practice, even though the asset library offers one for them. You cannot publish templates from the Console, and nothing reads a template's published copy.
Every page and every feature installation that uses a template reads the template's current working copy instead. That means an unfinished template change reaches every new page created from it, and it reaches an existing page as soon as someone reopens that page in the page designer. See Start a Page from a Template for what this means when you build pages.