Bozohttpd

Check-in [6d39f799f6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use existing content_map to provide cache control header per file type

Ideally I'd prefer to do it with a regex or partial match on the content type, but everything is already setup for us to piggyback on this instead. I.e. I'd like to do multiple arguments like this:

-h "image" "private, max-age=604800" -h "css" "private, max-age=86400"

or a single argument where we split the string on a comma:

-h "image,css" "private, max-age=604800"

but instead I am happy enough to be able to do:

-h .jpg "private, max-age=604800" -h .png "private, max-age=86400"

It's good enough for what I want to stop here.

- Adds a new cache-bozo.c file
- Adds a new field in the existing map used for the cache control header
- Extends all existing functions as required to reference this new field.

Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6d39f799f600f823d8d1cde2545aacd15e903a70
User & Date: atomicules 2017-12-02 22:37:55.196
Context
2021-05-20
21:31
Merge in latest upstream check-in: 1c8136037b user: atomicules tags: trunk
2017-12-02
22:37
Use existing content_map to provide cache control header per file type

Ideally I'd prefer to do it with a regex or partial match on the content type, but everything is already setup for us to piggyback on this instead. I.e. I'd like to do multiple arguments like this:

-h "image" "private, max-age=604800" -h "css" "private, max-age=86400"

or a single argument where we split the string on a comma:

-h "image,css" "private, max-age=604800"

but instead I am happy enough to be able to do:

-h .jpg "private, max-age=604800" -h .png "private, max-age=86400"

It's good enough for what I want to stop here.

- Adds a new cache-bozo.c file
- Adds a new field in the existing map used for the cache control header
- Extends all existing functions as required to reference this new field. check-in: 6d39f799f6 user: atomicules tags: trunk

2017-11-25
22:13
Set cache-control only for images

A bit of an intermediate commit, just investigating what works. I think really
need to be able to pass in a string and a cache-control header and it'll use
strstr to determine which header to set. I.e so you can pass in:

"image" "max-age=604800"
"css" "max-age=86400"

The bit I'm then missing is how to set a catch all or "owtelse" cache-control?
Maybe look for one argument? check-in: dda2552f49 user: atomicules tags: trunk

Changes
Unified Diff Side-by-Side Diff Patch
Changes to Makefile.
Changes to bozohttpd.c.
Changes to bozohttpd.h.
Added cache-bozo.c.
Changes to content-bozo.c.
Changes to dir-index-bozo.c.
Changes to main.c.