AssetManager
AssetManager copied to clipboard
Publish assets
AssetManager should have a way to collect all assets during the build process so static content could be deployed to CDN.
Requirements:
- view helper for static content location (path on development and production will be different)
- configuration will hold CDN location. Setting this will essentially //disable// AssetManager on production (there won't be any calls to AssetManager as all asset requests will go to CDN).
- cli controller to collect all static content managed by AssetManager
Any suggestions?
Some ideas:
- View helper could force internal lookup
- View helper forcing lookup would mean there's cache busting (based on file contents)
- Pushing to CDN could be done based on a hook (event?). Custom cacher (which would hook into the resolvers) will be responsible for comparing files.
- Hook could push files to CDN, and return path / url.
Downsides:
- You'll have to cache your front-end, or lookups through view helper (you can't have stats on every request.)