time.is_after

BOOLtime.is_afterTIMEt1TIMEt2

Available in all subroutines.

Returns true if t1 is after t2. (Normal timeflow and causality required.)

Example

if (time.is_after(now, time.hex_to_time(1000000,
beresp.http.X-Absolute-Cacheable-Microtime))) {
set obj.cacheable = 0;
} else {
set obj.cacheable = 1;
}

Try it out

time.is_after is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Time-limited URL tokens

Make URLs expire after a configurable period.

Dictionary based IP block list

Block a list of IP addresses from accessing your service and include an expiry time.

JSON web tokens

Decode the popular JWT format to verify user session tokens before forwarding trusted authentication data to your origin.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.