Precaching Best Practices
-
Hi,
There is something wrong in my app with the precaching setup.
If I set precaching route as follows, with no versioning, the app won’t work offline because it looks for the versioned script when running offline.
wp_register_service_worker_precaching_route('/wp-content/themes/astra-child/style.css',$args);
Then I have to set precaching route as follows for the app to work properly offline:
wp_register_service_worker_precaching_route('/wp-content/themes/astra-child/style.css?ver=1.0.0',$args);
So, I have to include a version for every script file (.js,.css) precached. This means that I will have to edit child theme’s functions.php every time there is an update in any of these versioned scripts.
Please advise on how to implement precaching best practices.
Thanks in advance for your help.
- The topic ‘Precaching Best Practices’ is closed to new replies.