Back to examples

API cache with HttpApi

Query defines the cache. Its execute Effect reads BlogClient from the application Layer and calls a typed HttpApi endpoint.

View source

Posts

Open a post, then go back. The list stays Success. reset clears cached post details; late responses for cleared entries are ignored. Open the same post again to load it fresh. The Cached badge uses postDetailQuery.read with the post identifier.

Loading posts…