Skip to content

[Static Web Assets] Define mechanism to fingerprint an asset relative path and generate new endpoints for it. #54874

Closed
@javiercn

Description

@javiercn
  • 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 be file.fingerprint.extension or file.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.

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.

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-static-web-assets

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions