integreat-cms
integreat-cms copied to clipboard
Update media file paths
Short description
Update media file paths when uploading a new file in order to avoid caching problems.
Proposed changes
Instead of making sure that a path gets reused when a media file is replaced, always create a new path for the new file, so that no caching problems occur. This is done by prepending the epoch time to the filename.
Then replace all internal links to the old path with links to the new path.
Side effects
- Hopfully none, old file paths should still work
Resolved issues
Fixes: #1168
Note to self: update https://github.com/digitalfabrik/integreat-app/issues/2130 when this is merged
Code Climate has analyzed commit 0cdaac9a and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 86.9% (50% is the threshold).
This pull request will bring the total coverage in the repository to 81.7% (0.1% change).
View more on Code Climate.
Is there any possibility to reproduce the bug locally? Trying the steps to reproduce in the issue description with Redis aktivated, it won't work 🤔
For more information about the current workaround the app team currently uses, you can take a look at their issue: https://github.com/digitalfabrik/integreat-app/issues/2130 With this pr, the path always changes which removes the need to redownload the files all the time.