Closed akshaymhk closed 1 month ago
Closing this issue because ownership of Critters has moved to the Nuxt team, who will be maintaining the project going forward. This repo is archived and won't receive any future updates.
If the issue is still relevant, please re-post it to the actively-maintained fork at https://github.com/danielroe/beasties.
Implement a feature to cache CSS based on a data attribute (e.g., data-pagetype). This will optimize the process by caching critical CSS, thereby improving the Time to First Byte (TTFB).
Proposed Solution:
1. Enable Feature:
cacheCriticalCSS: true
.2. HTML Structure:
<div>
element.<div>
.3. Unique Key:
4. Cache Implementation:
Benefits:
Example Usage:
<div class="page_layout_nxt" data-pagetype="homepage_loggedin_mobile">
<!-- Page content -->
</div>
When
cacheCriticalCSS
is set to true, the critical CSS for this specificdata-pagetype
will be cached and reused for subsequent requests with the same unique key.Pull Request:
https://github.com/GoogleChromeLabs/critters/pull/168