Commit ec59c33
Prevent page caches from storing content-negotiation redirect
Many full-page caches do not vary their cache key by the Accept
request header. When they store the 303 redirect from content
negotiation, all subsequent visitors are redirected to the .md
URL instead of seeing the HTML page.
Two complementary layers prevent this:
- Cache-Control: private header prevents shared caches (CDNs,
reverse proxies) from storing the redirect while allowing
browser caching.
- DONOTCACHEPAGE constant and LiteSpeed API call tell WP-level
page caches not to store the response. This is behind a filter
(markdown_alternate_disable_page_cache_on_redirect) so sites
with Vary-aware caching can opt out.
The .md URLs themselves remain fully cacheable.
Fixes #30
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 1f9979e commit ec59c33
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
375 | 391 | | |
376 | 392 | | |
377 | 393 | | |
| |||
0 commit comments