OpenResty based reverse proxy serving cached pages from Redis without Vue StoreFront (VSF or VSF API) calls, using LUA.
For every GET request, this proxy does the following:
utm_ ones) to increase cache-hit ratioThis allows achieving much better performances without needing to query VSF Node.js app.
Following environment variables must be set:
VSF_BACKEND_HOST: hostname (without HTTP or port) of VSF backendVSF_BACKEND_PORT: port of VSF backend (ie. 3000)VSF_API_BACKEND_HOST: hostname (without HTTP or port) of VSF API backendVSF_API_BACKEND_PORT: port of VSF API backend (ie. 3000)REDIS_HOST: hostname of Redis instanceREDIS_PORT: hostname of Redis instance (ie. 6379)VSF_CACHE_REMOVE_QS_ARGS: Query String params to remove to increase cache-hit ratio (separated by a comma, no whitespace), in addition to default ones (see redis_fpc.lua)The following patch in VSF code is required to expose the cache version:
core/scripts/server.[js|ts]
...
const fs = require('fs')
function cacheVersion (req, res) {
res.send(fs.readFileSync(resolve('core/build/cache-version.json')))
}
app.get('/cache-version.json', cacheVersion)
...
utm_*) trough an environment variable.js, .css, etc.)VSF Proxy source code is completely free and released under the MIT License.
Content type
Image
Digest
Size
44.5 MB
Last updated
over 5 years ago
docker pull clickandmortar/vsf-proxy