Skip to content

Instantly share code, notes, and snippets.

@kovyrin
Created May 3, 2010 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kovyrin/387612 to your computer and use it in GitHub Desktop.
Save kovyrin/387612 to your computer and use it in GitHub Desktop.
# Default TTL and grace
set obj.grace = 604800s;
set obj.ttl = 604800s;
# For really young (last-modified < 15 min ago) objects, use lower (1 min) ttl
if (obj.http.Last-Modified) {
C{
#include <sys/time.h>
struct timeval tv;
gettimeofday(&tv, 0);
if (tv.tv_sec - TIM_parse(VRT_GetHdr(sp, HDR_OBJ, "\016Last-Modified:")) < 900) {
VRT_l_obj_ttl(sp, 60);
}
}C
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment