<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft" -->

---
title: Permission caches need a kill switch | daily.dev
description: Caching authorization decisions ('is user X allowed to do Y?') can silently create stale-permission bugs when a role or policy changes but the cache still...
canonical: https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Permission caches need a kill switch | daily.dev
og:description: Caching authorization decisions ('is user X allowed to do Y?') can silently create stale-permission bugs when a role or policy changes but the cache still...
og:url: https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft
og:image: https://api.daily.dev/og/posts/ApQHxl6ft.png
og:image:alt: Permission caches need a kill switch
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Permission caches need a kill switch

**[Auth By Example](https://daily.dev/sources/7eadcwhmohx0bchehapmt)** · [@authbyexample](https://daily.dev/authbyexample) · 1 min read · 0 upvotes · 0 comments

## Summary

Caching authorization decisions ('is user X allowed to do Y?') can silently create stale-permission bugs when a role or policy changes but the cache still returns the old answer. Recommended practices include using short TTLs, invalidating caches on membership/role/policy changes rather than only on logout, and preferring to cache the inputs needed for a fresh decision instead of caching the final allow/deny result indefinitely. The core argument is that a stale allow is more dangerous than a slower permission check.

## Content

Caching "is user X allowed to do Y?" feels free until someone loses a role and the cache still says yes.

If you cache authorization decisions:

- Put a short TTL on them.
- Invalidate on membership, role, or policy change — not only on logout.
- Prefer caching the inputs you need for a fresh decision over caching the allow/deny bit forever.

A stale allow is worse than a slow check.

## Similar posts on daily.dev

- [Short-Lived Credentials in Agentic Systems: A Practical Trade-off Guide](https://daily.dev/posts/short-lived-credentials-in-agentic-systems-a-practical-trade-off-guide-h0cal49yt) · GitGuardian · 1 upvotes · 0 comments
- [Cache: Stop Asking the Database the Same Question](https://daily.dev/posts/cache-stop-asking-the-database-the-same-question-qjeabvnp4) · Medium · 1 upvotes · 1 comments
- [Why You're Getting 429s in Production and How to Stop Them](https://daily.dev/posts/why-you-re-getting-429s-in-production-and-how-to-stop-them-mhsytuyaf) · Auth0 · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#authentication](https://daily.dev/tags/authentication), [#authorization](https://daily.dev/tags/authorization)

[View this post on daily.dev](https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft","headline":"Permission caches need a kill switch","text":"Caching authorization decisions ('is user X allowed to do Y?') can silently create stale-permission bugs when a role or policy changes but the cache still returns the old answer. Recommended practices include using short TTLs, invalidating caches on membership/role/policy changes rather than only on logout, and preferring to cache the inputs needed for a fresh decision instead of caching the final allow/deny result indefinitely. The core argument is that a stale allow is more dangerous than a slower permission check.","url":"https://daily.dev/posts/permission-caches-need-a-kill-switch-apqhxl6ft","datePublished":"2026-09-19T09:41:45.263Z","dateModified":"2026-09-19T09:41:58.426Z","author":{"@type":"Person","name":"Auth By Example","url":"https://daily.dev/authbyexample","image":"https://media.daily.dev/image/upload/s--Fgz7IgGQ--/f_auto/v1789653205/avatars/avatar_7EADCwHmOHX0bChEhAPmt?_a=BAMAMicg0","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":60}},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/7eadcwhmohx0bchehapmt","name":"Auth By Example"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Auth By Example","item":"https://daily.dev/sources/7eadcwhmohx0bchehapmt"},{"@type":"ListItem","position":3,"name":"Permission caches need a kill switch"}]}
```

