AI content is generated dynamically, but reader-facing pages can still be highly cacheable. The two ideas are compatible if you know exactly when the cache must be invalidated.
Cogweald uses an appropriate ISR strategy for public story pages, archives, the homepage, and the library. After a chapter is successfully persisted, the cron route revalidates the relevant paths so the next reader sees the new content instead of waiting for a passive expiry.
There is an easy-to-miss detail: only a fully successful domain operation should trigger revalidation. If model generation succeeds but persistence fails, the page must not look like a chapter was published.
Cache invalidation is difficult not because the API is complicated, but because it must match the consistency semantics of your data.
When your AI content has a publishing concept, design generation, persistence, notifications, and cache updates as one event flow.
Top comments (0)