fix: prevent stale mini app mobile styles
This commit is contained in:
@@ -6,6 +6,9 @@
|
|||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
||||||
/>
|
/>
|
||||||
|
<meta http-equiv="Cache-Control" content="no-store" />
|
||||||
|
<meta http-equiv="Pragma" content="no-cache" />
|
||||||
|
<meta http-equiv="Expires" content="0" />
|
||||||
<meta name="robots" content="noindex, nofollow" />
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
<meta name="theme-color" content="#03070b" />
|
<meta name="theme-color" content="#03070b" />
|
||||||
<link id="app-favicon" rel="icon" href="/favicon.ico" sizes="any" />
|
<link id="app-favicon" rel="icon" href="/favicon.ico" sizes="any" />
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ _GZIP_BODY_CACHE: Dict[str, bytes] = {}
|
|||||||
_ASSET_NAME_CACHE: Dict[tuple[str, str], tuple[float, str]] = {}
|
_ASSET_NAME_CACHE: Dict[tuple[str, str], tuple[float, str]] = {}
|
||||||
_I18N_PAYLOAD_CACHE: Dict[tuple[int, str, tuple[tuple[str, int, int], ...]], Dict[str, Any]] = {}
|
_I18N_PAYLOAD_CACHE: Dict[tuple[int, str, tuple[tuple[str, int, int], ...]], Dict[str, Any]] = {}
|
||||||
_ASSET_NAME_CACHE_TTL_SECONDS = 30.0
|
_ASSET_NAME_CACHE_TTL_SECONDS = 30.0
|
||||||
|
WEBAPP_HTML_CACHE_CONTROL = "no-store, no-cache, must-revalidate, max-age=0"
|
||||||
|
WEBAPP_LEGACY_ASSET_CACHE_CONTROL = "no-store, no-cache, must-revalidate, max-age=0"
|
||||||
|
|
||||||
|
|
||||||
async def health_route(request: web.Request) -> web.Response:
|
async def health_route(request: web.Request) -> web.Response:
|
||||||
@@ -48,7 +50,7 @@ async def _css_asset_route(request: web.Request, *, base_name: str) -> web.Respo
|
|||||||
allow_precompressed=bool(asset_hash),
|
allow_precompressed=bool(asset_hash),
|
||||||
)
|
)
|
||||||
response.headers["Cache-Control"] = (
|
response.headers["Cache-Control"] = (
|
||||||
"public, max-age=31536000, immutable" if asset_hash else "no-cache"
|
"public, max-age=31536000, immutable" if asset_hash else WEBAPP_LEGACY_ASSET_CACHE_CONTROL
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@@ -901,7 +903,7 @@ async def _js_asset_route(request: web.Request, *, base_name: str) -> web.Respon
|
|||||||
strip_dev_mock=not asset_hash,
|
strip_dev_mock=not asset_hash,
|
||||||
)
|
)
|
||||||
response.headers["Cache-Control"] = (
|
response.headers["Cache-Control"] = (
|
||||||
"public, max-age=31536000, immutable" if asset_hash else "no-cache"
|
"public, max-age=31536000, immutable" if asset_hash else WEBAPP_LEGACY_ASSET_CACHE_CONTROL
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@@ -1182,7 +1184,9 @@ async def index_route(request: web.Request) -> web.Response:
|
|||||||
1,
|
1,
|
||||||
)
|
)
|
||||||
response = web.Response(text=html, content_type="text/html", charset="utf-8")
|
response = web.Response(text=html, content_type="text/html", charset="utf-8")
|
||||||
response.headers["Cache-Control"] = "no-cache"
|
response.headers["Cache-Control"] = WEBAPP_HTML_CACHE_CONTROL
|
||||||
|
response.headers["Pragma"] = "no-cache"
|
||||||
|
response.headers["Expires"] = "0"
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,9 @@ server {
|
|||||||
|
|
||||||
location ~* ^/subscription_webapp(_admin)?\.(css|js)$ {
|
location ~* ^/subscription_webapp(_admin)?\.(css|js)$ {
|
||||||
expires off;
|
expires off;
|
||||||
add_header Cache-Control "no-cache";
|
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
add_header X-Robots-Tag "noindex, nofollow, noarchive";
|
add_header X-Robots-Tag "noindex, nofollow, noarchive";
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
@@ -124,7 +126,9 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
add_header Cache-Control "no-cache";
|
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
add_header X-Robots-Tag "noindex, nofollow, noarchive";
|
add_header X-Robots-Tag "noindex, nofollow, noarchive";
|
||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,11 @@ body,
|
|||||||
overflow-x: clip;
|
overflow-x: clip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: var(--bg, #02070b);
|
background: var(--bg, #02070b);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
|
|||||||
Reference in New Issue
Block a user