cache-flags.ts 529 B

123456789101112131415
  1. import { appSetting } from 'app/config'
  2. import { isWeb } from 'app/lib/util'
  3. /**
  4. * In-memory page / conductor / wiki caches.
  5. * Web: `cache.enable_web`. Native: `cache.enable_native`.
  6. * `false` disables them so navigation refetches from the server.
  7. *
  8. * Checked against `false` explicitly: a fork whose settings lack the key must
  9. * keep caching on rather than silently lose it.
  10. */
  11. export function isPageCacheEnabled() {
  12. const key = isWeb ? 'enable_web' : 'enable_native'
  13. return appSetting('cache', key) !== false
  14. }