Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short description and why it's useful
Currently, the cache is persisted in Redis until the expiration, which can lead to issues with serving old content after deployment, if this cache will not be manually cleaned.
These changes are related to the build process and
redis-tag-cache
package setup.In the first step during the server build, I generate the UUID and save it to
core/build/cache-version.json
file.Then when the server is firing up, it reads saved previously UUID and uses it to set
keyPrefix
which help us distinguish the correct version of the cache.Why not generate UUID directly in
server.js
? We can spawn multiple instances of this server, so each of them will have on the cache, which is not efficient.Upgrade Notes and Changelog
There are no changes required, just under the hood magic, but if someone was currently clearing all the cache during deployment, it's not necessary anymore.
Questions
If manual cache clearing is not so useful anymore, should be kept
yarn cache
andcore/script/cache.js
?If we should keep it, it also needs to read the content of
cache-version.json
, so maybe will be good to abstract the logic of creating cache instance 馃