Comments (2)
Hi @rafaelschmitt!
How about this?
$ RAND=$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 32)
$ app/console assets_v:set $RAND
Setting parameter assets_version in assets_version.yml to 'a3bbc4645d5f078712ec73e1f4c90907'...
Done. Clearing of prod cache is required.
You can find out more about generating random strings here:
http://stackoverflow.com/questions/2793812/generate-a-random-filename-in-unix-shell
I am deliberately not adding assets_version:set:random
command because I donβt find it safe. Although you can generate pretty long sequences of characters, there is still a chance of hitting the same value. If auto-incrementing of assets_version
does fit the needs of your project, Iβd recommend using a more controlled value. For example, this can be the current timestamp:
$ app/console assets_v:set $(date +"%s")
Setting parameter assets_version in assets_version.yml to '1427469781'...
Done. Clearing of prod cache is required.
from kachkaevassetsversionbundle.
Ok, thank you for your fast and clear answer ;)
This will help us a lot. And you are right, a random hash would be not really safe -> chance of hitting same value.
We will use a combination of timestamp + short hash. Only timestamp would be unsafe for us, because there is a chance that two (or more) installations are started at the absolute same time.
Thanks ;)
from kachkaevassetsversionbundle.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kachkaevassetsversionbundle.