From de9bc130d5d1a11e9cc1e6b292b844dfb982afd0 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Fri, 31 May 2024 01:42:51 -0500 Subject: [PATCH] docs: Add info about configuring Cache-Control header --- README.md | 4 ++++ compose.yaml | 24 ++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b5fbf4c..f78b6f9 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,10 @@ the `slug_length` variable. It defaults to 8, and a minimum of 4 is supported. To enable public mode, set `public_mode` to `Enable`. With this, anyone will be able to add links. Listing existing links or deleting links will need admin access using the password. +By default, the server sends `no-cache` and `private` Cache-Control headers. To disable those, +set `cache_control_header` to `Disable`. It might help boost performance if served through a +proxy. + ## Instructions for CLI usage The application can be used from the terminal using something like `curl`. In all the examples below, replace `http://localhost:4567` with where your instance of `chhoto-url` is accessible. diff --git a/compose.yaml b/compose.yaml index 12bdf21..3eeec8e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -9,32 +9,36 @@ services: ports: - 4567:4567 environment: - # Change if you want to mount the database somewhere else + # Change if you want to mount the database somewhere else. # In this case, you can get rid of the db volume below - # and instead do a mount manually by specifying the location + # and instead do a mount manually by specifying the location. # - db_url=/urls.sqlite # Change it in case you want to set the website name # displayed in front of the shorturls, defaults to - # the hostname you're accessing it from + # the hostname you're accessing it from. # - site_url=https://www.example.com - password=$3CuReP4S$W0rD - # Pass the redirect method, if needed TEMPORARY and PERMANENT - # are accepted values, defaults to PERMANENT + # Pass the redirect method, if needed. TEMPORARY and PERMANENT + # are accepted values, defaults to PERMANENT. # - redirect_method=TEMPORARY - # By default, the auto-generated pairs are adjective-name pairs - # If you want UIDs, please change slug_style to UID - # Supported values for slug_style are Pair and UID - # The length is 8 by default, and a minimum of 4 is allowed + # By default, the auto-generated pairs are adjective-name pairs. + # If you want UIDs, please change slug_style to UID. + # Supported values for slug_style are Pair and UID. + # The length is 8 by default, and a minimum of 4 is allowed. # - slug_style=Pair # - slug_length=8 # In case you want to provide public access to adding links (and not - # delete, or listing), change the following option to Enable + # delete, or listing), change the following option to Enable. # - public_mode=Disable + + # By default, the server sends `no-cache` and `private` Cache-Control + # headers. To disable those, change the following option to Disable. + # - cache_control_header=Enable volumes: - db:/urls.sqlite networks: