⚡ Bolt: Implement module-level cache for BlogApp data#92
Conversation
…equests This commit introduces `fetchPromise` and `cachedPayload` outside the `BlogApp` component to effectively cache the static payload retrieved from `/api/blog.json`. Due to the OS interface behavior where apps are frequently mounted and unmounted, relying on component-level state causes unnecessary API calls for identical data. Impact: Saves ~1 network roundtrip per Blog App open event after the initial fetch, drastically reducing overhead and slightly improving perceived rendering speed when toggling apps. Co-authored-by: schmug <38227427+schmug@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Superseded by #127 (merged to main), which consolidated the best of the duplicate Bolt/Sentinel/Palette scheduled-agent PRs into one reviewed change. Closing as duplicate. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What: Added a module-level caching mechanism (
fetchPromiseandcachedPayload) tosrc/components/os/apps/BlogApp.tsx.🎯 Why: The OS shell interface frequently mounts and unmounts application windows. By keeping state inside
BlogApp, every re-opening of the app triggered a fresh redundant API request to/api/blog.jsonfor effectively static content.📊 Impact: Reduces redundant API fetches by exactly 100% after the first cache load. Saves a network roundtrip every time the Blog app is re-opened, contributing to smoother, immediate OS transitions.
🔬 Measurement: Open the "Blog" app, close it, and reopen it while observing the Network tab. Previously, this fired multiple API calls; now it caches correctly after the first. All existing tests passing.
PR created automatically by Jules for task 7199183064583099376 started by @schmug