Title: Static assets are served with a 10-minute TTL: every user re-downloads ~4 MB of unchanged JS all day · Issue #212 · vpython/glowscript · GitHub
Open Graph Title: Static assets are served with a 10-minute TTL: every user re-downloads ~4 MB of unchanged JS all day · Issue #212 · vpython/glowscript
X Title: Static assets are served with a 10-minute TTL: every user re-downloads ~4 MB of unchanged JS all day · Issue #212 · vpython/glowscript
Description: app.yaml sets no default_expiration and no per-handler expiration:, so GAE applies its default of 10 minutes to every static file: $ curl -sI https://www.glowscript.org/package/glow.3.2.min.js | grep -i cache-control cache-control: publi...
Open Graph Description: app.yaml sets no default_expiration and no per-handler expiration:, so GAE applies its default of 10 minutes to every static file: $ curl -sI https://www.glowscript.org/package/glow.3.2.min.js | gr...
X Description: app.yaml sets no default_expiration and no per-handler expiration:, so GAE applies its default of 10 minutes to every static file: $ curl -sI https://www.glowscript.org/package/glow.3.2.min.js | gr...
Opengraph URL: https://github.com/vpython/glowscript/issues/212
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Static assets are served with a 10-minute TTL: every user re-downloads ~4 MB of unchanged JS all day","articleBody":"`app.yaml` sets no `default_expiration` and no per-handler `expiration:`, so GAE applies its default of **10 minutes** to every static file:\n\n```\n$ curl -sI https://www.glowscript.org/package/glow.3.2.min.js | grep -i cache-control\ncache-control: public, max-age=600\n```\n\n`glow.3.2.min.js` is **4.3 MB**. A student in a two-hour lab re-downloads it roughly a dozen times.\n\n## What the traffic looks like\n\nA 2000-request sample of the last 24h of `request_log`. **99% of bytes are static assets**:\n\n| URL | bytes | requests |\n|---|---|---|\n| `/package/glow.3.2.min.js` | **158.1 MB** | 43 |\n| `/package/RScompiler.3.2.min.js` | 45.1 MB | 41 |\n| `/lib/ace/ace.js` | 10.1 MB | 20 |\n| `/lib/jquery/2.1/jquery-ui.custom.min.js` | 7.9 MB | 42 |\n| `/lib/plotly.js` | 6.0 MB | 1 |\n| `/` (the app itself) | 2.2 MB | 323 |\n\n(A sample, not a daily total — but the *ratio* is the point.)\n\n## ⚠️ The obvious fix is unsafe for the file that matters most\n\n`default_expiration: 365d` looks like a one-line win. It is not, and the reason is worth recording.\n\nThe version in the filename is the **release line, not the content**. `glow.3.2.min.js` has **65 commits and last changed 2025-03-29** — it keeps being modified under a fixed URL. Pinning it for a year would leave a stale copy in students' browsers after a fix ships, with no way to bust it.\n\nThe rule is: a long TTL is safe **only if the URL changes when the bytes change.**\n\nOlder lines *are* effectively frozen:\n\n| file | size | last changed | commits |\n|---|---|---|---|\n| `package/glow.3.2.min.js` | 4308 KB | **2025-03-29** | **65** |\n| `package/glow.3.1.min.js` | 4296 KB | 2021-10-22 | 10 |\n| `package/glow.3.0.min.js` | 4295 KB | 2021-03-25 | 21 |\n| `package/glow.2.9.min.js` | 4293 KB | 2020-05-01 | 19 |\n| `package/glow.2.8.min.js` | 5222 KB | 2019-06-20 | 1 |\n| `package/glow.2.7.min.js` | 4398 KB | 2019-06-19 | 73 |\n| `package/RScompiler.3.2.min.js` | 1357 KB | 2024-01-09 | 28 |\n| `package/RSrun.3.2.min.js` | 107 KB | 2022-08-04 | 4 |\n| `lib/plotly.js` | 5821 KB | 2018-08-09 | 3 |\n| `lib/ace/ace.js` | 529 KB | 2022-03-18 | 8 |\n\n## Proposal — three tiers\n\n**1. Frozen release lines** — `expiration: 365d` per handler, today. `glow.3.1` and older have not changed in 4+ years; a new release gets a new filename. Zero risk.\n\n**2. Vendored third-party** — `lib/ace`, `lib/jquery`, `lib/plotly.js`. Versioned by directory or frozen since 2018, and not ours to modify. Same treatment.\n\n**3. The current dev line** (`glow.3.2.min.js`, `RScompiler.3.2.min.js`) — where the 158 MB actually is, and the one that cannot take a long TTL as-is. Needs a content-derived URL so it changes when the bytes do. More work, and worth doing separately.\n\nTiers 1 and 2 are a few lines of YAML and take a real bite out of egress on their own.\n\n## Not a CDN problem\n\nWorth stating so nobody reaches for the wrong tool: GAE already serves these from Google's edge. Unlike the Cloud Run deploys, no CDN needs adding — the only thing missing is the cache policy.\n\nFound while investigating unrelated `/google/auth` 500s (#210 / #211).","author":{"url":"https://github.com/sspickle","@type":"Person","name":"sspickle"},"datePublished":"2026-09-06T12:33:53Z","url":"https://github.com/vpython/glowscript/issues/212"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:15717718-84d9-9643-da34-2f767f31684d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 817A:215B38:69F08F:902D1F:6B0077C1 |
| html-safe-nonce | 51bf7842f05dbe03fdf93d6fe48f0240d563c92db8b2894098ddf931e3227675 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTdBOjIxNUIzODo2OUYwOEY6OTAyRDFGOjZCMDA3N0MxIiwidmlzaXRvcl9pZCI6IjMyODU1NTA3NTIzMTA3ODU5ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 360ed267dfa522cf7ffc5523a8650978cc04f5c0650d8449eaff22f1671a92d3 |
| hovercard-subject-tag | issue:5364965800 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vpython/glowscript/212/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4aea7c768700dd503573c768219a6d93ff069d9c5481bedae3093a0027b5fa6d/vpython/glowscript/issues/212 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4aea7c768700dd503573c768219a6d93ff069d9c5481bedae3093a0027b5fa6d/vpython/glowscript/issues/212 |
| og:image:alt | app.yaml sets no default_expiration and no per-handler expiration:, so GAE applies its default of 10 minutes to every static file: $ curl -sI https://www.glowscript.org/package/glow.3.2.min.js | gr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sspickle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16 |
| turbo-cache-control | no-preview |
| go-import | github.com/vpython/glowscript git https://github.com/vpython/glowscript.git |
| octolytics-dimension-user_id | 1280757 |
| octolytics-dimension-user_login | vpython |
| octolytics-dimension-repository_id | 187905631 |
| octolytics-dimension-repository_nwo | vpython/glowscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 187905631 |
| octolytics-dimension-repository_network_root_nwo | vpython/glowscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84e563eb4b55f8fa102f325f117533cee9e3df4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width