Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GromNaN opened this issue Feb 17, 2020 · 1 comment · Fixed by #35762
Closed

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

GromNaN opened this issue Feb 17, 2020 · 1 comment · Fixed by #35762

Comments

@GromNaN
Copy link
Member

GromNaN commented Feb 17, 2020

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.
@GromNaN
Copy link
Member Author

GromNaN commented Feb 17, 2020

Might be a duplicate of #33001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants