- Reverse Proxy the one target
- Cache filetypes
- Cache specific pages
- Docker Image available (Dockerfile)
These instructions will cover usage information about the go application and for the docker container image. This reverse proxy only supports HTTP (no HTTPS support for target). Speed up TTFB up to 1 - 15 ms.
In order to run this container you'll need docker installed.
Start a simple reverse proxy container to localhost:8080
docker run -p 80:80 -e PROXY_PORT=80 -e PROXY_TARGET=http://localhost:8080 -e CONFIG_FILE= /config/cache.config --name gocacheproxy switzerchees/gocacheproxy
Link the reverse proxy with a webapp for caching between
docker run -p 80:80 -e PROXY_TARGET=http://wordpress:80 --link wordpress:wordpress --name gocacheproxy switzerchees/gocacheproxy
/healthcheck
- Check if the webserver is running (httpstatus 200 success)/flushcache
- flush the actual cache/cacheactive
- activate or deactivate the cache functionality (POST allows toggle)
PROXY_PORT
- Port of the Reverse Proxy (Default: 80PROXY_TARGET
- Target to redirect traffic (Default: http://localhost:8080)CONFIG_FILE
- Path to the configuration files for define files to cache (Default: /config/cache.config)PROXY_CACHE_HTTP_HEADER
- Header to Check if File comes from cache (Default: X-GoProxy: FromCache im file comes from the reverse proxy cache)
{mimetype}image/jpeg
- The files with the ending mime-type jpeg are cached{page}/
- With the prefix {page} you can specify a specific page or resource to cache
- {mimetype}text/css
- {mimetype}application/javascript
- {mimetype}text/javascript
- {mimetype}image/jpeg
- {mimetype}image/gif
- {mimetype}image/png
- {mimetype}image/svg+xml
- {page}/