Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Apr 11, 2024
1 parent a5f5c86 commit 25f1d4a
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

[production]
node >= 20.9.0
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Locals

Expand Down
8 changes: 4 additions & 4 deletions .env.vault
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="7GW98NfL4hM4N6HbfeDXCKreVxKvcVPupFRnZ8XJ+pomaQ=="
DOTENV_VAULT_MAIN_VERSION=1

# dev
DOTENV_VAULT_DEV="tx+AF0/wIv83wy2NXqUftMKOwPA1DFytmxZ9Qky7IxAqLsi6pHx8YZJL2Nz/mQWeimEiKyE9+P059dZv30rsfoSUj1isROf1Prt0Mt7/u5BMTjxL1FUnTGbow9DH/ux2mcetcNWgsAzt6SX2t4piGaJoNFaMcV51x7FNYtmdvzXz64Fb0XhaoHORtFzzty9W11ck8FEsp5WtPoOgCVcUfAYOhqqOTwdpA+DwU81yfdEbG5y3N2MeRW/LLpLxC4YzBQ=="
DOTENV_VAULT_DEV_VERSION=539
DOTENV_VAULT_DEV="X+sBdBmkwgJE/a/hzf6jSJu91xivh5yPbDNjPHIN3kUWGKlzjbWh6bKCNmzpT2sC0owFgZ/R7R4f3mwgWHfg9Xf+zwEaMek24/V551CUyid79ysq7xOse2yFkelm9SsscG+ML6zHHAYv1Cw7alr4zvmXMgyl6U+B9BgM2DA+tLHMJpQApUp+3yNSWSUp/Wf3UBysI/femwWj72pU/VGo/fHtBQ0IdiWYQXXzpYbZWEt4/M3AogkMahPEEiNXEQPl2g=="
DOTENV_VAULT_DEV_VERSION=541

# ci
DOTENV_VAULT_CI="cWnpmjrAeOsw2xSVnQFnDj/H6XTg6kMqKNm8AjGhu0KotThxUmQk0DKO6Xje2/KzBiTB4h49AAAeDSFx6L9B663iJHXAqjEUtw4Qf3fnn9tSNAthc9IgQdBvdt4aOF+QkxXv6kVSKPQc6wlEaMFebpfZ6A/OS4NNe2dekNB8Jw=="
DOTENV_VAULT_CI_VERSION=539
DOTENV_VAULT_CI="vnrCPcwxExEIa5nOZsOGKL4xAg7nw4caLK2cbtUxo6WoFNfpONcC13+AY10qCZJAjori3/GB32FQwQbYx5k76SJow7i6cuFXLQ2Ww3S2Ahcr98jeCA19ssjFZ+gDll77ErMrsgBr+3loK95alJvHaDTgKTeICEpxw4p+qBk7vA=="
DOTENV_VAULT_CI_VERSION=541

# stage
DOTENV_VAULT_STAGE="aRP8su2YV4jZu3w1HZ/SLaots0IwJDFw75TCpvXEFeNp7tw="
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Default

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Packages

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./settings.mjs`.
*
* Last generated using `./settings.mjs` Apr 11, 2024 10:22 AM UTC.
* Last generated using `./settings.mjs` Apr 11, 2024 11:08 AM UTC.
*/
{
"editor.formatOnType": false,
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 11, 2024 10:22 AM UTC.
# Last generated Apr 11, 2024 11:08 AM UTC.

# Locals

Expand Down
90 changes: 45 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.0.956",
"version": "1.0.957",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities",
"description": "Utilities for JavaScript apps running in any environment.",
Expand Down Expand Up @@ -326,7 +326,7 @@
"ignore": "5.3.0",
"ip-regex": "5.0.0",
"micro-memoize": "4.1.2",
"micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.146",
"micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.147",
"parse-css-color": "0.2.1",
"preact": "10.20.1",
"preact-render-to-string": "6.4.1",
Expand All @@ -337,7 +337,7 @@
"optionalDependencies": {},
"bundleDependencies": [],
"devDependencies": {
"@clevercanyon/dev-deps": "^1.0.381"
"@clevercanyon/dev-deps": "^1.0.382"
},
"overrides": {},
"cpu": ["x64", "arm64"],
Expand Down
13 changes: 10 additions & 3 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,13 @@ const prepareResponseHeaders = async (request: $type.Request, url: $type.URL, cf
cacheHeaders['cache-control'] = 'no-store';
cacheHeaders['cdn-cache-control'] = 'no-store';
} else {
if ('none' === cfg.cacheVersion) {
if (
'none' === cfg.cacheVersion ||
!requestHasCacheableMethod(request) ||
requestPathIsInAdmin(request, url) ||
requestPathIsInAccount(request, url) ||
(!cfg.cacheUsers && requestIsFromUser(request))
) {
sMaxAge = 0; // No server-side cache.
} else {
// 1h minimum on Cloudflare paid workers plan.
Expand All @@ -767,9 +773,10 @@ const prepareResponseHeaders = async (request: $type.Request, url: $type.URL, cf
}
staleAge = Math.max($is.integer(staleAge) ? staleAge : Math.round(maxAge / 2), 0);
staleAge = 0 === staleAge ? 0 : $to.integerBetween(staleAge, 0, Math.min(maxAge, $time.dayInSeconds * 90));
const staleDirectives = 'stale-while-revalidate=' + String(staleAge) + ', stale-if-error=' + String(staleAge);

cacheHeaders['cache-control'] = 'public, must-revalidate, max-age=' + String(maxAge) + ', s-maxage=' + String(sMaxAge) + ', stale-while-revalidate=' + String(staleAge) + ', stale-if-error=' + String(staleAge); // prettier-ignore
cacheHeaders['cdn-cache-control'] = 0 === sMaxAge ? 'no-store' : 'public, must-revalidate, max-age=' + String(sMaxAge) + ', stale-while-revalidate=' + String(staleAge) + ', stale-if-error=' + String(staleAge); // prettier-ignore
cacheHeaders['cache-control'] = 'public, must-revalidate, max-age=' + String(maxAge) + ', s-maxage=' + String(sMaxAge) + ', ' + staleDirectives;
cacheHeaders['cdn-cache-control'] = 0 === sMaxAge ? 'no-store' : 'public, must-revalidate, max-age=' + String(sMaxAge) + ', ' + staleDirectives;
}
if (cfg.encodeBody && !$is.nul(cfg.body)) {
cacheHeaders['cache-control'] += ', no-transform';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./tsconfig.mjs`.
*
* Last generated using `./tsconfig.mjs` Apr 11, 2024 10:22 AM UTC.
* Last generated using `./tsconfig.mjs` Apr 11, 2024 11:08 AM UTC.
*/
{
"include": ["./src/**/*", "./dev-types.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @note This entire file will be updated automatically.
# @note Instead of editing here, please review `./wrangler.mjs`.
#
# Last generated using `./wrangler.mjs` Apr 11, 2024 10:22 AM UTC.
# Last generated using `./wrangler.mjs` Apr 11, 2024 11:08 AM UTC.
##

send_metrics = false
Expand Down

0 comments on commit 25f1d4a

Please sign in to comment.