Available in all subroutines.

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


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. Recipes apply VCL to real-world use cases and can be deployed as-is, or adapted for your own service. See the full list of recipesfor more inspiration.

Click RUN on a sample below 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.