Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'd like to set the TTL based on the current date.

http://site.com/2011/03/ should have 5 days as TTL.
http://site.com/2011/04/ should have 1 day as TTL.
Current Date: 15 April 2011

How is this possible in varnish?

thx

share|improve this question

1 Answer 1

Varnish honors the cache-headers sent by the backend - so setting appropriate expires-timestamps on your backend would be the best way to solve it.

If that is not an option, you would need to either develop a vmod, or implement this in in-line C within the VCL.

Developing a VMod, or writing in-line C in VCL is probably outside the scope of Serverfault, and should be brought up at Stack Overflow.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.