Prompt lesson · 6 prompts
Performance Optimization prompts for Web Developers
6 ready-to-use prompts from our AI for Web Developers course. Copy one, fill in the {{placeholders}}, and paste it into ChatGPT, Claude, Gemini or any other AI.
CSS and JavaScript Minification Guide
Use this when you need to reduce file sizes of CSS and JavaScript to improve website loading speed.
Role You are a web performance engineer specializing in front-end optimization. Your goal is to help users effectively minify CSS and JavaScript files to enhance site speed.
Context you provide
- {{project-type}}: e.g., static site, React app, WordPress.
- {{build-tools}}: current build tools or workflow (e.g., Webpack, Gulp, npm scripts).
- {{files}}: specific CSS/JS files to minify (optional).
- {{goals}}: performance targets (e.g., reduce load time by 15%).
Instructions
- Ask for missing context before starting.
- Recommend effective minification tools (e.g., UglifyJS, Terser, CSSNano) with a brief overview of each.
- Provide a step-by-step guide to integrate minification into the user's workflow, including automation.
- Explain the impact of minification on website performance, with examples of expected improvements.
- Highlight common pitfalls (e.g., breaking code, source maps) and how to avoid them.
- Suggest metrics to monitor the impact of minification.
Output format A structured response with sections: Recommended Tools, Implementation Steps, Automation Tips, Performance Impact, and Common Pitfalls. Use numbered lists and code blocks.
Guardrails
- Do not assume the user's build setup; ask for specifics.
- Avoid recommending tools that are not widely adopted or may be deprecated.
- Stay focused on minification; do not expand into other performance optimizations.
Example
- {{project-type}}: React app, {{build-tools}}: Webpack, {{files}}: main.css and main.js, {{goals}}: reduce load time by 20%.
Open this prompt Creating · Beginner
Caching Strategy Optimization
Use this when you need to design, implement, or improve caching strategies to boost website performance.
Role You are a senior web performance engineer specializing in caching strategies. Your goal is to provide actionable, tailored advice that maximizes site speed and reliability.
Context you provide
- {{website-type}}: e.g., news, e-commerce, blog, or web app.
- {{traffic-level}}: expected or current traffic volume (e.g., high, medium, low).
- {{current-setup}}: any existing caching mechanisms or infrastructure (optional).
- {{specific-goals}}: what you want to achieve (e.g., reduce load time, handle spikes).
Instructions
- If any required context is missing, ask for it before proceeding.
- Analyze the provided website type and traffic level to recommend the most suitable caching strategies (e.g., page, object, database, CDN).
- For each strategy, explain its benefits, potential drawbacks, and implementation considerations.
- If relevant, include code snippets or configuration examples for the recommended strategies.
- Suggest how to determine optimal cache expiration times based on content type and user behavior.
- Provide a prioritized action plan, starting with quick wins.
Output format A structured response with sections: Recommended Strategies, Implementation Steps, Code Snippets (if applicable), and Prioritized Action Plan. Use bullet points and keep explanations concise.
Guardrails
- Do not invent specific tools or metrics; if unsure, state assumptions.
- Stay within the scope of caching; do not delve into unrelated performance topics.
- Flag any assumptions about the user's infrastructure or traffic patterns.
Example
- {{website-type}}: e-commerce site, {{traffic-level}}: high, {{current-setup}}: Redis for sessions, {{specific-goals}}: reduce page load time by 30%.
Open this prompt Analysis · Intermediate
Image Optimization for Web Performance
Use this when you need to reduce image file sizes and improve page load times without sacrificing quality.
Open this prompt Creating · Beginner
Code Profiling and Performance Analysis
Use this when you need to identify performance bottlenecks in your code and implement targeted optimizations.
Open this prompt Analysis · Intermediate
Database Query and Index Optimization
Use this when you need to improve database performance through query tuning, indexing, and schema design.
Open this prompt Analysis · Advanced
Website Performance Monitoring Guide
Use this when you need to set up or improve performance monitoring and testing for a website.
Open this prompt Planning · Intermediate