Huge performance boost and easy to configure
-
Biggest speed improvement is when I added navigation pre-load filter:
add_filter( 'wp_service_worker_navigation_caching_strategy', function() { return WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE; } ); add_filter( 'wp_service_worker_navigation_caching_strategy_args', function( $args ) { $args['cacheName'] = 'pages'; $args['plugins']['expiration']['maxEntries'] = 50; return $args; } );
Resulting in sub 200ms page load time!
I’m also using it to cache images, css, js.
Easy to update manifest as well through filter:
function get_manifest_update( $manifest ) { /* $manifest = array( 'name' => wp_kses_decode_entities( get_bloginfo( 'name' ) ), 'start_url' => home_url( '/' ), 'display' => 'minimal-ui', 'dir' => is_rtl() ? 'rtl' : 'ltr', ); */ // Add argument to $manifest array $manifest['start_url'] .= 'en/page/support/'; $manifest['short_name'] = 'My App'; $manifest['name'] = 'Full name of app'; return $manifest; } add_filter( 'web_app_manifest', 'get_manifest_update' );
Hopefully this will be added to WP core soon! Thanks for making it easy to implement service workers with hooks as well, great way to introduce Devs to PWA!
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Huge performance boost and easy to configure’ is closed to new replies.