You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stream Ollama (openai) chat completion API on CLI with HTTPie and jq
Stream Ollama (openai) chat completion API on CLI with HTTPie and jq
Explanation
This command sends a request to the Chat Completion API to generate high-level documentation for the file @src/arch.js. The API is configured to use the llama3-gradient model and to respond in Markdown format.
The messages array contains two elements:
The first element is a system message that provides the prompt for the API.
The second element is a user message that specifies the file for which to generate documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Laravel's Hidden Cache::grace() Pattern Solves the Stale-While-Revalidate Problem
How to serve cached content instantly while updating it in the background—the pattern major CDNs use, now in your Laravel app
Cache invalidation is one of the two hard problems in computer science, and Laravel's standard cache methods force you into an uncomfortable choice: serve stale data or make users wait for fresh data. The Cache::grace() pattern eliminates this trade-off by implementing the stale-while-revalidate strategy that powers major CDNs and high-performance web applications.
This isn't just another Laravel macro—it's a fundamental shift in how you think about caching. Instead of choosing between speed and freshness, you get both: instant responses for users and background updates to keep data current. The pattern is so effective that it's built into HTTP standards (RFC 5861) and used by services like Cloudflare, but most Laravel developers have never heard of it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters