meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ixc2024:tech:wfrontend:criteria:greencode [2024/05/22 14:17] – created rubenhuygens | ixc2024:tech:wfrontend:criteria:greencode [2024/05/22 15:38] (current) – alesta | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Here are 20 best practices derived from the concepts in the "Green Code" book: | + | ==== Green Code Suggestions ==== |
- | * Unordered List ItemMinimize | + | |
- | * Implement Efficient Caching: Use browser caching to store static resources locally on the user's device. This reduces the need for repeated downloads. | + | Here are ~20 best practices |
- | * Optimize Images and Videos: Compress images and videos using tools like ImageOptim or HandBrake. Serve images in next-gen formats like WebP and videos in optimized formats like MP4. | + | |
- | * Lazy Loading: Implement lazy loading for images and videos | + | Reduce emissions: |
- | * Reduce Unused Code: Regularly audit and remove unused CSS, JavaScript, | + | * **Minimize |
- | * Efficient Font Loading: Use only the necessary font weights and styles. Consider using system fonts to reduce the need for external font loading. When using web fonts, ensure they are loaded asynchronously and consider subsetting fonts to include only the characters needed. | + | |
- | * Simplify Design: Focus on minimalistic design to reduce the amount of CSS and JavaScript required. Simplified designs are often more user-friendly and faster to load. | + | |
- | | + | |
- | | + | |
- | * Optimize for Accessibility: | + | * **Optimize Images and Videos:** Compress images and videos using tools like ImageOptim or HandBrake. Serve images in next-gen formats like WebP and videos in optimized formats like MP4. |
- | | + | * **Use SVGs:** Where appropriate, |
- | * Use Content | + | * **Optimize Forms and User Inputs:** Reduce the size of user-uploaded images |
- | * Implement Dark Mode: Offer a dark mode option for OLED screens, which can save battery life for users. Ensure that dark mode is implemented efficiently without duplicating resources. | + | |
- | * Use Efficient JavaScript Libraries: Choose lightweight JavaScript libraries and frameworks that offer the required functionality without excessive overhead. For instance, consider using Preact instead of React for smaller applications. | + | * |
- | * Optimize Forms and User Inputs: Reduce | + | |
- | * Static Site Generation: Consider using static site generators for websites | + | |
- | * Progressive Web Apps (PWAs): Develop | + | |
- | * Use SVGs: Where appropriate, | + | * **Efficient Animations:** Use CSS animations instead of JavaScript for better performance and lower energy consumption. Avoid heavy animations that can drain device battery and processing power. |
- | * Monitor | + | |
- | * Educate and Collaborate: Ensure | + | |
- | * | + | * **Reduce HTTP Requests:** Combine files where possible (e.g., CSS sprites, combined JavaScript files) to minimize the number of HTTP requests required to load a page. |
+ | * **Energy Efficient | ||
+ | * **Monitor and Optimize Performance:** Regularly monitor your website' | ||
+ | |||
+ | |||
+ | Accessibility: | ||
+ | * **Simplify Design:** Focus on minimalistic design to reduce | ||
+ | * **Responsive Design:** Use responsive design principles to ensure | ||
+ | * **Optimize for Accessibility:** Ensure | ||
+ | |||
+ | |||
+ | Increase maintainability: | ||
+ | * **Reduce Unused Code:** Regularly audit and remove unused CSS, JavaScript, and other resources. Tools like PurifyCSS can help identify | ||
+ | |||
+ | |||
+ | Finally: | ||
+ | * **Holistic approach:** Understand both the business logic behind the solution |