• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Technology

      Web technology reference for developers

  • Guides
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • MDN Plus
    • Overview

      More MDN. Your MDN.

    • FAQ

      Frequently asked questions about MDN Plus

  • Already a subscriber?
  • Get MDN Plus
  1. 指数
  2. ServiceWorkerGlobalScope.caches

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

In this article

  • 语法
  • 规范
  • 浏览器兼容性
  • 参见

Related Topics

  1. Service Worker API
  2. Caches
  3. Related pages for Service Workers API
    1. Cache
    2. CacheStorage
    3. Client
    4. Clients
    5. ExtendableEvent
    6. FetchEvent
    7. InstallEvent
    8. Navigator.serviceWorker
    9. NotificationEvent
    10. PeriodicSyncEvent (en-US)
    11. PeriodicSyncManager (en-US)
    12. ServiceWorker
    13. ServiceWorkerContainer
    14. ServiceWorkerGlobalScope
    15. ServiceWorkerRegistration
    16. SyncEvent (en-US)
    17. SyncManager (en-US)
    18. WindowClient

In this article

  • 语法
  • 规范
  • 浏览器兼容性
  • 参见

ServiceWorkerGlobalScope.caches

caches 是一个 ServiceWorkerGlobalScope 接口的只读属性,返回与当前service worker相关联的CacheStorage对象。

语法

var myCacheStorage = self.caches;

返回值

一个 CacheStorage 对象。

规范

规范 状态 备注
Service Workers
ServiceWorkerGlobalScope.caches
Working Draft Initial definition.

浏览器兼容性

No compatibility data found for api.ServiceWorkerGlobalScope.caches.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

参见

  • Using Service Workers
  • Service workers basic code example
  • Is ServiceWorker ready?
  • Promise
  • Using web workers

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: 2021年11月13日, by MDN contributors

MDN logo

Your blueprint for a better internet.

  • MDN on Twitter
  • MDN on GitHub

MDN

  • About
  • Hacks Blog
  • Careers

Support

  • Product help
  • Report a page issue
  • Report a site issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
Mozilla logo
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2022 by individual mozilla.org contributors. Content available under a Creative Commons license.