×

注意!页面内容来自https://github.com/helmetjs/nocache,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

Skip to content
<> /* Override primer focus outline color for marketing header dropdown links for better contrast */ [data-color-mode="light"] .HeaderMenu-dropdown-link:focus-visible, [data-color-mode="light"] .HeaderMenu-trailing-link a:focus-visible { outline-color: var(--color-accent-fg); }

helmet/nocache

Repository files navigation

Middleware to turn off caching

This Express middleware sets some HTTP response headers to try to disable client-side caching.

To use it:

const nocache = require("nocache");

// ...

app.use(nocache());

This sets three headersdisabling a lot of browser caching:

  • Cache-Control: no-storeno-cachemust-revalidateproxy-revalidate
  • Expires: 0
  • Surrogate-Control: no-store

You may wish to do this if you want to ensure that users have up-to-date resourcesor if you want to clear out an old version for some reason.