Closed
Description
- We will support defining tokens in the relative path, very similar to how tokens work in ASP.NET Core routing that will be substituted at the time we compute the file path and respective endpoint routes with specific values.
For example, fingerprinting a file is specified as _path/to/file[.{fingerprint}].ext
[.{fingerprint}]
is a replacement expression that indicates where the fingerprint needs to go and what other literals (very much like complex segments) need to be applied when the fingerprint is used, so that the final result can befile.fingerprint.extension
orfile.extension
. We don't make any assumption on where the fingerprint or its format needs to be.- The
{fingerprint}
in the relative path is used through the pipeline to identify what endpoints to define and their paths. - A given expression like the above can be optional if suffixed by
?
as for example_path/to/file[.{fingerprint}]?.ext
to mean the following:- Make the file routable through the fingerprinted endpoint if possible in addition to its regular path but do not fingerprint the actual file path on disk.
- This is because there are some files we don't have control of (like CSS) and we want to make sure that those assets are still reachable through their original paths.
- Make the file routable through the fingerprinted endpoint if possible in addition to its regular path but do not fingerprint the actual file path on disk.
Whenever we need to use the endpoints, we resolve the fingerprint based on the asset to compute the final paths for files and routes for endpoints.