H2O

the optimized HTTP/1.x, HTTP/2, HTTP/3 server

Powered by Oktavia

Configure > Expires Directives

This document describes the configuration directives of the expires handler.

Description:

An optional directive for setting the Cache-Control: max-age= header.

  • if the argument is OFF the feature is not used
  • if the value is NUMBER UNIT then the header is set
  • the units recognized are: second, minute, hour, day, month, year
  • the units can also be in plural forms
Example. Set Cache-Control: max-age=86400
expires: 1 day

You can also find an example that conditionally sets the header depending on the aspects of a request in Modifying the Response section of the Mruby directives documentation.

Level:
global, host, path, extension