Skip to content

[Asset][RFC] Support remote manifest.json #35761

Closed
@GromNaN

Description

@GromNaN

Description
The JsonManifestVersionStrategy requires the manifest.json to be a local file. That is checked with file_exists.

I would like to download a manifest over HTTP from a remote service that exposes assets.

  • The case is a set of js libraries (mainly ads & partners related) shared with multiple websites.
  • This libraries can be updated anytime in a backward-compatible way. I don't want to deploy a new configuration of my application to get updates.
  • Assets are served with very long TTL (or Cache-Control: immutable) to get the best browser performances (i.e. a high score in Google Page Speed).

Example

Existing:

framework:
    assets:
        json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'

Expected:

framework:
    assets:
        json_manifest_url: 'https://cdn.example.com/manifest.json'

Implementation:

  • The HttpClient component should be used and injected in the new **VersionStrategy.
  • Cache policy can be configured on HttpClient level. Directives like stale-while-revalidate and stale-if-error will be recommended.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions