Skip to content
Back to skills

Dns Cache Layer

ASecurity

Use when caching DNS responses with TTL and prefetch.

  • 2 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 10, 2026
ai-agentspythonrustgoperformance

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill dns-cache-layer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dns Cache Layer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dns Cache Layer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-dns-cache-layer/badge)](https://www.skillsdirectory.com/skills/loopyluci-dns-cache-layer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dns-cache-layer
title: DNS Cache Layer
description: Use when caching DNS responses with TTL and prefetch.
category: networking
tags: [dns, cache, performance, lru, concurrent, rust]
---

# DNS Cache Layer

**Trigger**: Use when implementing DNS response caching, prefetching, or negative caching.

## Key Libraries
- **Rust**: `lru`, `moka` (high-perf concurrent cache), `dashmap`, `scc`
- **Python**: `cachetools`, `aiocache`

## Implementation
1. Two-tier cache: L1 (hot, moka concurrent, ~10K) + L2 (warm, scc sharded, ~1M)
2. TTL-aware eviction with min/max bounds (clamp to configurable range)
3. Negative caching: cache NXDOMAIN with short TTL (60-300s) to reduce upstream load
4. Prefetch: predict popular domains via frequency tracking; refresh before TTL expiry
5. Serialization for persistence via `bincode` or `messagepack`

## Connected Skills
`dns-adblock-engine`, `encrypted-dns-resolver`, `realtime-dashboard`, `traffic-analyzer`

## Pitfalls
- Concurrent eviction + prefetch causes thundering herd — use `moka::try_get_with`
- Serialization must include expiry timestamps, not just TTL

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.