class AssetsRevision
Produces a single token representing the current state of all compiled asset revisions, so a long-lived client can detect when the assets it booted with have been superseded (e.g. after a rebuild or extension toggle).
The token is derived solely from {[\Flarum\Frontend\Compiler\VersionerInterface::allRevisions()},](../../../Flarum/Frontend/Compiler/VersionerInterface.html) so it honours whatever versioner is bound — including a custom one. The same computation must be reproducible on the client from the `revisions` payload it boots with, so the manifest is canonicalised (sorted by key) before hashing.
Methods
Canonicalise a revisions map (sort by key) and hash it, so the server and client produce the same token from the same manifest regardless of order.
Details
at
line 24
__construct(VersionerInterface $versioner)
at
line 29
string
token()
at
line 50
static string
tokenFor(array $revisions)
Canonicalise a revisions map (sort by key) and hash it, so the server and client produce the same token from the same manifest regardless of order.
Admin-only assets are excluded: the token exists to tell a *forum* client that what it loaded has been superseded, but the manifest is shared with the admin frontend. Without this, rebuilding any admin asset — e.g. toggling an admin-only extension — would move the token and prompt every forum visitor to reload for a change that cannot affect them. Forum and shared (`common`) chunks stay in: the forum can load those, so a genuine change to one must still trigger the prompt.