Web Performance Optimization

Web Performance Optimization

Guides an AI coding agent to speed up web apps with code splitting, lazy loading, caching, compression and monitoring to improve Core Web Vitals.

Skill files7 files

references/

templates/

SKILL.md90 lines
1
---
2
name: web-performance-optimization
3
description: >
4
Optimize web application performance using code splitting, lazy loading,
5
caching, compression, and monitoring. Use when improving Core Web Vitals and
6
user experience.
7
---
8
9
# Web Performance Optimization
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement performance optimization strategies including lazy loading, code splitting, caching, compression, and monitoring to improve Core Web Vitals and user experience.
22
23
## When to Use
24
25
- Slow page load times
26
- High Largest Contentful Paint (LCP)
27
- Large bundle sizes
28
- Frequent Cumulative Layout Shift (CLS)
29
- Mobile performance issues
30
31
## Quick Start
32
33
Minimal working example:
34
35
```typescript
36
// utils/lazyLoad.ts
37
import React from 'react';
38
39
export const lazyLoad = (importStatement: Promise<any>) => {
40
return React.lazy(() =>
41
importStatement.then(module => ({
42
default: module.default
43
}))
44
);
45
};
46
47
// routes.tsx
48
import { lazyLoad } from './utils/lazyLoad';
49
50
export const routes = [
51
{
52
path: '/',
53
component: () => import('./pages/Home'),
54
lazy: lazyLoad(import('./pages/Home'))
55
},
56
{
57
path: '/dashboard',
58
lazy: lazyLoad(import('./pages/Dashboard'))
59
},
60
{
61
// ... (see reference guides for full implementation)
62
```
63
64
## Reference Guides
65
66
Detailed implementations in the `references/` directory:
67
68
| Guide | Contents |
69
|---|---|
70
| [Code Splitting and Lazy Loading (React)](references/code-splitting-and-lazy-loading-react.md) | Code Splitting and Lazy Loading (React) |
71
| [Image Optimization](references/image-optimization.md) | Image Optimization |
72
| [HTTP Caching and Service Workers](references/http-caching-and-service-workers.md) | HTTP Caching and Service Workers |
73
| [Gzip Compression and Asset Optimization](references/gzip-compression-and-asset-optimization.md) | Gzip Compression and Asset Optimization |
74
| [Performance Monitoring](references/performance-monitoring.md) | Performance Monitoring |
75
76
## Best Practices
77
78
### ✅ DO
79
80
- Follow established patterns and conventions
81
- Write clean, maintainable code
82
- Add appropriate documentation
83
- Test thoroughly before deploying
84
85
### ❌ DON'T
86
87
- Skip testing or validation
88
- Ignore error handling
89
- Hard-code configuration values
90

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…