Cache
Caching Behavior and Test Cases
Arxignis honors your origin server’s caching directives.
1. Cache Decision Flow
flowchart TD
A[Client Request] --> B{Method is GET?}
B -->|No| Z[Do Not Cache]
B -->|Yes| C{Has Set-Cookie header?}
C -->|Yes| Z
C -->|No| D{Cache-Control header}
D -->|private, no-store, no-cache, max-age=0| Z
D -->|public with max-age > 0| E[Cache - TTL from max-age]
D -->|missing or unrecognized| F{Expires header present?}
F -->|Future date| G[Cache - TTL from Expires header]
F -->|No header or expired| H[Cache based on status code]
E --> I[Store and Serve]
G --> I
H --> I
2. No-Cache Conditions
Arxignis does not cache the resource when any of the following are true:
- HTTP method ≠
GET
. Set-Cookie
header is present.Cache-Control
header includes any of:private
no-store
no-cache
max-age=0
3. Cache-Allowed Conditions
Arxignis does cache the resource when any of the following are true and no earlier “no-cache” rule applies:
-
Cache-Control: public; max-age=N
→ Cache with TTL =N
seconds. -
Expires: <future-date>
→ Cache with TTL = (Expires
− now). -
No
Cache-Control
header → Cache based on the HTTP status code (e.g. 200 OK).
Note If both
max-age
andExpires
are present,max-age
takes precedence.
4. Default Cached File Extensions
Arxignis caches by file extension (not by MIME type). By default, Arxignis does not cache .html
or .json
but does cache robots.txt
.
A–F | G–L | M–R | S–Z |
---|---|---|---|
.7Z | .GZ | .MIDI | .SVG |
.AVI | .ICO | .MKV | .SVGZ |
.APK | .JAR | .MP3 | .SWF |
.BIN | .JPEG | .MP4 | .TAR |
.BMP | .JPG | .OGG | .TF (TTF) |
.BZ2 | .JS | .WEBM | |
.CLASS | .MID | .PLS | .WEBP |
.CSV | .MP3 | .PPT | .WOFF |
.CSS | .MPEG | .PPTX | .WOFF2 |
.DOC | .OGG | .RAR | .XLS |
.DOCX | .OTF | .SVG | .XLSX |
.DMG | .SWF | .ZIP |
7. Test Matrix
Below are example test cases to validate Arxignis caching logic.
# | Method | URL | Cache-Control | Expires | Set-Cookie | Ext. | Expected |
---|---|---|---|---|---|---|---|
1 | GET | /image.png | private, max-age=3600 |
— | — | .png | No cache (private) |
2 | GET | /style.css | public, max-age=600 |
— | — | .css | Cached (TTL=600s) |
3 | GET | /index.html | — | Fri, 30 Dec 2099 |
— | .html | No cache (HTML not cached by default) |
4 | GET | /robots.txt | — | — | — | .txt | Cached (status-based) |
5 | GET | /data.json | public, max-age=0 |
— | — | .json | No cache (max-age=0) |
6 | GET | /download.zip | — | — | — | .zip | Cached (status-based) |
7 | GET | /post/submit | — | — | — | — | No cache (no extension & default) |
8 | POST | /api/submit | public, max-age=3600 |
— | — | — | No cache (method ≠ GET) |
9 | GET | /preview.jpg | no-store |
— | — | .jpg | No cache (no-store) |
10 | GET | /video.mp4 | — | Thu, 01 Jan 1970 |
— | .mp4 | No cache (expired Expires) |
11 | GET | /icon.svg | public, max-age=120 , Expires: future |
— | — | .svg | Cached (use max-age=120 over Expires) |
12 | GET | /secret.bin | — | — | ID=1234 |
.bin | No cache (Set-Cookie present) |
- Status-based caching (200 OK, .png/.zip)
- Edge Cache TTL can be tested by asserting TTL ≠ origin header TTL.
- Origin Cache-Control Off (Enterprise) should allow you to bypass origin directives.
How to Run These Tests
- Send HTTP requests as defined in the test matrix.
- Inspect the
Age
header or your/cache-status
log to verify hits vs. misses and TTLs. - Repeat with an overriding Edge TTL rule to confirm override behavior.