https://github.com/straight-shoota/nginx-cache-test
Test for nginx cache setup
https://github.com/straight-shoota/nginx-cache-test
nginx-configuration testing
Last synced: 9 months ago
JSON representation
Test for nginx cache setup
- Host: GitHub
- URL: https://github.com/straight-shoota/nginx-cache-test
- Owner: straight-shoota
- License: mit
- Created: 2017-02-10T23:54:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T12:14:11.000Z (over 9 years ago)
- Last Synced: 2025-10-07T01:37:26.950Z (9 months ago)
- Topics: nginx-configuration, testing
- Language: Shell
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is just a simple test setup to explore nginx caching capabilities regarding cache bypass and purge.
## Usage
```
./setup.sh # Enables nginx server config and restarts nginx
crystal backend.cr # Start simple backend server with encrementing counter and caching header
./test.sh # Run some curls agains the nginx frontend to ensure caching functionality
```
1. Subsequent requests are served from Nginx's proxy_cache
2. If the request has header "cachepurge: true", nginx cache is bypassed and the new response cached for future requests
3. Requests with param "preview_token" are never cached
[Github Repository](https://github.com/straight-shoota/nginx-cache-test)