You can configure Liberator to purge (remove) the contents of named directories from its cache at regular intervals. An object is only removed from the cache if no client is subscribed to it. Here's how to configure cache purging:
You use the following three options of the add-object configuration item to control when Liberator purges directories from its cache:
- purge-time: The time when the Liberator is to start purging the objects in the directory. This time is the number of minutes after midnight (local time) on the day the Liberator was started, or if it's greater than or equal to
1440(24 hours), it's the number of minutes past midnight on a Sunday.
- purge-age: When
purge-ageis present and isn't zero, only objects in the directory that haven't been updated for
purge-ageminutes are candidates for removal.
- purge-period: The number of minutes between successive purges following the first purge at
This configuration causes Liberator to purge all objects under the directory
/I/CHARTS at 2am every morning, provided no clients are subscribed to the directory when the purge is attempted:
add-object name /I/CHARTS type directory purge-time 120 purge-period 1440 end-object
Here we haven't configured a
purge-age, and because this option's default value is zero, all non-subscribed objects in the directory can be purged, regardless of when they were last updated.
purge-time is set to
120 mins, which is 2 hours after midnight, and
1440 minutes, which is every 24 hours.
Here are some variants of this configuration:
- To purge the directory at midnight every day, set
- To purge the directory at 3am and 3pm every day, set
180( 3 hrs past midnight) and
- To purge the directory every hour, set
This example shows how to use the
add-object name /I/CHARTS type directory purge-time 0 purge-period 1440 purge-age 7 end-object
This configuration makes Liberator purge objects under the directory
/I/CHARTS at midnight (
0) every day (
1440 mins = 24 hrs), but it only purges those objects that haven't been updated for a week (
7 mins = 7 days)
Here are some variants of the above configuration:
purge-age = 1, only objects that haven't been updated for
1440minutes (1 day) are purged.
60(1 hour) and
6, objects not updated for 6 hours are purged hourly.
purge-ageto control how old particular objects should be before they're actually purged.
This example shows how to configure a directory purge once a week at a specific time relative to midnight on a Sunday:
add-object name /DIR1 type directory purge-time 8760 purge-period 10080 end-object
The purge-time of
8760 mins is 6 days and 2 hours, which is greater than 24 hrs. So the first purge starts at 6 days and 2 hours after midnight on Sunday; that is at 2 am on the following Sunday. The purge-period of
10080 mins is 7 days, so subsequent purges start at 2 am every Sunday.