Skip to content

Cookbook: Keeping your metadata cache clear during testing

Mark Jordan edited this page Dec 8, 2017 · 7 revisions

When MIK fetches metadata from CONTENTdm, a CSV file, or a remote OAI repository, it caches the metadata locally so that it doesn't need to retrieve it again later in its execution cycle (for example, to generate a MODS document), it gets the metadata from its cache instead of the original source. Metadata is cached in the location defined in the temp_directory setting in your .ini file.

As with any cached data, this can cause unexpected results. During testing, for example, you may want to tell MIK not to reuse the cached metadata. You can clear out the cache after MIK run, forcing the fetcher to refetch the data. To do this, add this line to the [WRITER] section of your .ini file:

shutdownhooks[] = "php extras/scripts/shutdownhooks/delete_temp_files.php"

This script will delete MIK's cached data just before MIK exists, ensuring that the cache is clean the next time MIK runs.

Note that filegetters and some manipulators store stuff in the temp directory, so this shutdown script will delete these files as well. However, removing these files will have no effect other than a potential increase in how long it takes MIK to execute.

Clone this wiki locally