-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs for use-browser-cache * Update WebServer Parameter_ use-browse-cache.tid remove timestamps * revert last change * move to webserver folder * clarify, typos * dedupe
- Loading branch information
1 parent
1fb9098
commit d3722a6
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
editions/tw5.com/tiddlers/webserver/WebServer Parameter_ use-browse-cache.tid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
caption: use-browse-cache | ||
created: 20240413042652008 | ||
modified: 20240413050841387 | ||
tags: [[WebServer Parameters]] | ||
title: WebServer Parameter: use-browser-cache | ||
type: text/vnd.tiddlywiki | ||
|
||
The [[web server configuration parameter|WebServer Parameters]] ''use-browser-cache=yes'' activates 200 OK browser caching via the `Cache-Control` header and a smart a Etag header: | ||
|
||
* The server javascript creates an MD5 `hash` object. | ||
* Adds the data of the current `request:response` (for example: json text or an image binary) to the hash object. | ||
* Adds the current `headers` of the response to the hash object. | ||
* If the response data has an `encoding` value, adds the encoding to the hash object. | ||
* Calculates the final MD5 hash string as a `contentDigest` javascript variable, and saves it as an `Etag: "<<contentDigest>>"` header. | ||
|
||
If the incoming request contains a header named `if-none-match`, then the server will check the generated Etag against all values. | ||
|
||
If any `if-none-match` value DOES match the current Etag, the server will send a `304 NOT MODIFIED` response with the current response headers, instead of the data with a `200 OK` response. | ||
|
||
This saves bandwidth, as the client can be sure they have already received the exact data and has it in their current cache. | ||
|
||
If ''use-browser-cache=no'' (or any other value including null), then the server will return a `Cache-Control: no-store` header by default. | ||
|
||
If any customer server route module defines custom `Cache-Control` header behavior, then the server will pass that header through instead of the default. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters