| @@ -163,21 +163,15 @@ | ||
| 163 | 163 | * (shell or chromeless iframe) is answered locally for every later |
| 164 | 164 | * window, revalidation round-trips included. See `src/pwa/sw-policy.ts` |
| 165 | 165 | * for the exact classification rules. |
| 166 | 166 | * |
| 167 | - * Off by default while the feature proves itself: the failure mode of | |
| 168 | - * cache-first (an asset edited without a `ver` bump staying pinned) is | |
| 169 | - * silent, so users opt in deliberately — via **OpenStation Preferences → | |
| 170 | - * Features → Beta features** (`adminAssetCacheEnabled`, per user), or | |
| 171 | - * site-wide via the filter below. | |
| 167 | + * Enabled by default. Administrators can opt out site-wide through | |
| 168 | + * OpenStation Preferences → Features → Extended options → Shared asset | |
| 169 | + * cache. The filter below can force or veto the site-wide setting. | |
| 172 | 170 | * |
| 173 | - * Per-user works even though a service worker is origin-wide because | |
| 174 | - * the answer never travels in the worker's own bytes. It is resolved | |
| 175 | - * per request here and pushed to the running worker as an `os-sw-config` | |
| 176 | - * message when the shell boots, and again whenever the preference | |
| 177 | - * changes — see {@see openstation_pwa_sw_config_preamble()} for why | |
| 178 | - * baking it into the script was abandoned. The worker starts with the | |
| 179 | - * cache off, so until that message lands it does less, never more. | |
| 171 | + * The shell posts the resolved flag to the running worker at boot. | |
| 172 | + * Changes apply after reloading OpenStation; the served worker bytes | |
| 173 | + * remain identical for logged-in and anonymous requests. | |
| 180 | 174 | * |
| 181 | 175 | * @return bool |
| 182 | 176 | */ |
| 183 | 177 | function openstation_pwa_admin_asset_cache_enabled() { |
| @@ -188,16 +182,15 @@ | ||
| 188 | 182 | * Filters whether the SW's shared admin-asset cache is enabled. |
| 189 | 183 | * |
| 190 | 184 | * Return `true` to let the service worker cache versioned admin |
| 191 | 185 | * static assets in a shared, origin-wide bucket, or `false` to |
| 192 | - * veto it site-wide regardless of per-user opt-ins. The value | |
| 186 | + * veto it regardless of the Extended option. The value | |
| 193 | 187 | * reaches the worker as an `os-sw-config` message on the next shell |
| 194 | 188 | * boot, so a change takes effect without altering the served script |
| 195 | 189 | * — no SW update, no URL change, no re-registration. |
| 196 | 190 | * |
| 197 | - * @param bool $enabled Defaults to the requesting user's | |
| 198 | - * `adminAssetCacheEnabled` OpenStation | |
| 199 | - * preference (`false` until they opt in). | |
| 191 | + * @param bool $enabled The site-wide `admin_asset_cache` Extended | |
| 192 | + * option, enabled by default. | |
| 200 | 193 | */ |
| 201 | 194 | return (bool) apply_filters( 'openstation_pwa_admin_asset_cache', $enabled ); |
| 202 | 195 | } |
| 203 | 196 | |