I'm using the FastCGI cache on one of my sites. Caches of most pages should be valid for 30days (as they get flushed on any change anyways) but caches of some pages should only be valid for 1day.

To overwrite the setting Max age cache in minutes I would like to have a variable $fastcgi_cache_valid available in the FastCGI configuration to overwrite the cache duration on a per site basis.

Example:

# set default max age cache
set $fastcgi_cache_valid 30d;

# Use different max age cache for events page
if ($request_uri ~* "/events$") {
    set $fastcgi_cache_valid 24h;
}

Make `$fastcgi_cache_valid` available in the FastCGI configuration

1 total vote
  • 7ils moved item to project Sites

    3 hours ago
  • 7ils created the item

    3 hours ago