Question

Despite of doing it in each file type handler, is there any simple way to set default expiry date of all types of file, e.g. json, jpg, html, css, js, etc?

Was it helpful?

Solution

As Nagi said, the connection handler called /handlers/main.c can be used to generate custom expiration HTTP headers.

You can also use content-type handlers which name in the /handlers directory must match the file type (html.c, json.c, jpg.c, etc.).

By default, G-WAN generates HTTP headers which may help proxy servers to do their job:

Date:           Thu, 29 Nov 2012 15:00:55 GMT
Last-Modified:  Sun, 25 Nov 2012 13:54:46 GMT
ETag:           "810c7fa9--50b22326-7ec3"

But a more fine-grained strategy can be used. That could be done in a future version by defining those content-related expirations in content-type handlers.

Proof that a server is a living (customer-driven) creature:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top