Branch: Tag:

2021-05-05

2021-05-05 13:50:33 by 0

Add CACHE_INDEFINITELY() macro and associated limits to flag resources that
besides being cacheable also don't need any expires call-outs in Roxen. This
avoids long lists of rather pointless call-outs one year or more into the
future.

441:       // Only the actual cache entry is expired.    // FIXME: This could lead to lots and lots of call outs.. :P -  meta->co_handle = call_out(really_low_expire_entry, expire, key); +  meta->co_handle = +  (expire < CACHE_INDEF_REL_LIMIT) && +  call_out(really_low_expire_entry, expire, key);    int n;    while( (current_size > max_size) && (n++<10))    clear_some_cache();
2314:    case "roxen":    // Mark all /internal-roxen-* as cacheable even though the user might be    // authenticated (which normally disables protocol-level caching). -  RAISE_CACHE(60 * 60 * 24 * 365); // 1 year +  CACHE_INDEFINITELY();    PROTO_CACHE();    id->set_response_header("Cache-Control", "public, max-age=31536000");