back to network first caching

This commit is contained in:
Martti Malmi 2023-03-04 20:44:19 +02:00
parent a83c37259b
commit 7b46935343
2 changed files with 5 additions and 2 deletions

View File

@ -128,7 +128,9 @@ class Login extends Component {
autoFocus
onInput={(e) => this.onPasteKey(e)}
placeholder={t('paste_private_key')}
type="password"
/>
{this.state.privateKeyError && <div className="error">{this.state.privateKeyError}</div>}
</>
);
}

View File

@ -22,8 +22,9 @@ registerRoute(
// Make root page load instantly, even if offline. Tradeoff: after app update, user will see old version until they refresh.
registerRoute(
({ url }) => url.pathname === '/',
new StaleWhileRevalidate({
new NetworkFirst({
cacheName: 'iris-main',
networkTimeoutSeconds: 3,
plugins: [
new CacheableResponsePlugin({
statuses: [0, 200], // no 404
@ -64,9 +65,9 @@ registerRoute(
},
new NetworkFirst({
cacheName: 'pages-etc',
networkTimeoutSeconds: 3,
plugins: [
new ExpirationPlugin({
networkTimeoutSeconds: 5,
maxEntries: 100,
maxAgeSeconds: 30 * 24 * 60 * 60,
purgeOnQuotaError: true,