Scenario
An agency wishes to ensure that old, outdated versions of files are not left on the site. Users may bookmark individual files and keep referring to them, even though they are no longer relevant. These files must be either removed (404) or updated.
Challenge
The standard Drupal behaviour is to create a new file, with a new URL when Media is updated. This decision was made to preserve the old file and not delete data that may still be valuable. However, as seen, this has problems. The end result is that multiple older versions of files can hang around.
Solution
There are two solutions to this problem:
- Overwriting files (fast-moving zombies): The addition of the Media Entity File Replace module allows the site builder to specify that the old file should be overwritten when updated. This approach ensures that no legacy files are ever created as they are being overwritten.
- Mopping up unused files (slow-moving zombies): The addition of the Media File Delete also makes it possible to mop up and delete files that are no longer in use on the site. This can happen when a File is no longer attached to an entity and is not used on the site. The module makes it possible to mark the files as suitable for deletion on the next cron run.
Outcome
Zombie files, which expose the agency to risk, can be mostly managed through the sensible configuration of the site using modules that are available in GovCMS SaaS.