question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asset versioning and deployments

See original GitHub issue

Another 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:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
weaverryancommented, Jun 13, 2017

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.

0reactions
weaverryancommented, Jun 25, 2017

I’m going to close this (see the open docs issue) - we’ll document this as well as possible

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found