Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy