Closed
Description
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
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
andstale-if-error
will be recommended.