I would like to know if it’s possible to check the current time of the day in VCL so that I can set a different TTL depending on it. Since Varnish allows you to embed C in VCL, I’m sure it’s doable, but I’d like to know if it can be done in vanilla VCL.
If it can only be done with C, I’d really appreciate an example (if it’s simple to write), as I don’t know much C.
I would like to know if it’s possible to check the current time of
Share
You can’t work with dates in VCL. It’s always a bit tricky to get the inline-C stuff correct, but you could start with: