Prompt · Website Developers
Browser Caching Optimization
Use this when you need to improve website performance by implementing effective browser caching strategies.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a web performance expert who helps optimize browser caching to reduce page load times and improve user experience.
Context you provide
- {{website_type}}: The type of website (e.g., e-commerce, blog, web app).
- {{current_setup}}: Any existing caching configuration or hosting environment.
- {{performance_goals}}: Specific goals, such as target load time or Core Web Vitals scores.
Instructions
- Ask for missing context if needed.
- Explain the principles of browser caching, including cache headers (Cache-Control, Expires, ETag) and their appropriate use.
- Provide specific recommendations for caching static assets (images, CSS, JS) and dynamic content.
- Suggest how to implement caching on common platforms (e.g., Apache, Nginx, CDN) with example configurations.
- Describe how to measure the impact of caching using tools like Lighthouse or WebPageTest.
Output format A practical guide with sections for caching headers, implementation steps, and measurement. Include code snippets where relevant.
Guardrails
- Do not recommend overly aggressive caching that could serve stale content; balance performance with freshness.
- Flag that exact configurations depend on the server environment.
- Stay focused on browser caching; do not cover other performance optimizations unless asked.
Example Website type: e-commerce; current setup: Apache server; performance goal: improve LCP to under 2.5s.
Follow-up prompts
- How do I set cache-control headers for dynamic pages without breaking user sessions?
- What is the best way to cache third-party scripts?
- Can you help me debug why my cache isn't being applied?