How to manually set cache time (ttl) for specific URL?
search cancel

How to manually set cache time (ttl) for specific URL?

book

Article ID: 166456

calendar_today

Updated On:

Products

Advanced Secure Gateway Software - ASG ProxySG Software - SGOS

Issue/Introduction

Some URLs cache TTL is set too long even though the contents can be updated more frequently. So I need to reduce the cache TTL to a shorter value.

 

 

Resolution

You can set the time-to-live (TTL) value of an object in the cache, in seconds, by using CPL or VPM policy rule.

Upon expiration, the cached copy is considered stale and will be re-obtained from the origin server when next accessed. However, this property has an effect only if the following HTTP command line option is enabled: Force explicit expirations: Never serve after. If the above option is not set, the ProxySG appliance’s freshness algorithm determines the time-to-live value.

From VPM:
Add web content layer (or on existing Web content layer) -> Add rule -> right-click on Destination -> set request URL
From the same rule, right-click on Action -> click Set -> click New -> Set TTL -> set the TTL value (seconds) -> OK -> OK
Install policy
 

CPL in local policy

Example
<Cache>
; Delete the specified cached objects after 30 seconds.
url=//www.example.com/dyn_images ttl(30)