Asset versioning and deployments
See original GitHub issueAnother question asked on Symfony Slack (@jderusse asked it):
regarding the new
Encore
component and asset versioning (http://symfony.com/doc/current/frontend/encore/versioning.html) what is the simplest strategy to avoid 404 during a deployment (1) user gets http page pointing to asset version A, 2) a new version B of the app is deployed, 3) user ask for asset A which no longer exists) Why not using a “queryString” strategy like describe in http://symfony.com/doc/current/frontend/custom_version_strategy.html
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Oracle ATG Web Commerce - Versioning Process
Versioning Process. When you initially import assets into ATG Content Administration, the VersionManager creates version 1 of every imported asset. In the case ......
Read more >How to control your deployments and versioning with ...
It all starts with a commit message. Structured commit messages will be the very basis of the automation process. Another git entity as...
Read more >Asset Versioning (Symfony Docs)
Asset Versioning and Deployment. When deploying a new version of your application, versioned assets will include a new hash, making the previous assets...
Read more >Elixir asset versioning and git deployments - Laracasts
Just started using elixir but I'm not sure how to properly integrate this into my deployment cycle. Here's what I'm doing: Run gulp...
Read more >Change the Version of an API Asset - MuleSoft Documentation
Each API asset contains a Version field for the asset version, and an API ... You can deploy an API asset directly into...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The only fool-proof approach is a “never delete old assets” approach… or at least a "only delete old assets… after some time has passed). This is pretty standard if you’re using a CDN - e.g. CloudFront I believe keeps your old assets for 24 hours.
In summary: A) Best Solution: Don’t delete old assets, either by removing
cleanupOutputBeforeBuild()
or using a CDN that stores your old asset URLs for a little while B) Great Solution: Use a decent deploy (e.g. the Capistrano philosophy) where you completely finish deploying and building your code before new traffic hits things. You shouldn’t see any 404’s, except in edge-cases (that Stof mentioned). C) Not Great Solution If you have a deploy that continually serves traffic and deletes the old assets (e.g. an Rsync solution), your assets will 404 for a little while during deploy. Either make your deploy process better or use a different versioning method (like what Stuf suggested)There’s nothing to do in Encore, but we could add a small note about this in the versioning section.
I’m going to close this (see the open docs issue) - we’ll document this as well as possible