%

Relayd: Web caching for httpd

Article published the ; modified the
One minute to read

This article has 201 words.
RAW source of the article:
Commit version: e21600e

Description

OpenBSD has, by default, in basesystem, since 5.7:

  • a webserver, named httpd,

  • un server relay, named relayd

  • Website: https://bsd.plumbing/

  • OpenBSD: 6.6, 6.7


httpd is not able to manage delivery about cache static content.

So we pass the relay to the relayd server which is able to do it; so, it does in the global manner, not-domain specific.

Configuration

We need to modify the httpd and relayd configuration, i.e.:

  • relayd will receive all traffic on web port and redirects to localhost on corresponding ports. Off course, il possible to act on both IPv4 and IPv6 protocols.
  • httpd will query only the localhost on the dedicated ports.

Do not forget to restart both daemons after modyfing the configuration.

relayd

  • File configuration is: /etc/relayd.conf

In the contexte of the http protocol:

  • We target all static files, by scanning all web requests:
    • for the image GIF, JPEG, PNG, SVG
    • for the CSS and JS files
    • and others HTML and XML files (as Atom, RSS, Sitemap, etc.)
  • we apply a tag policy, with the option tag.
  • and finally, we send an header Cache-Control, labelled by the tag.

Next, we apply the http protocol to a target relay.

relayd: example

Code: relayd

Documentations

Manpages