Page 1 of 1

Service Worker syntax for precache, network first, no cache

Posted: Fri Dec 06, 2019 10:03 pm
by dmccreary663
I've installed a few progressive web apps for joomla, but am getting odd behaviors from administrator side. using pwabuilder.com there is a sample service worker for Advanced caching. Three options
/* Add an array of files to precache for your app */
/* Add an array of regex of paths that should go network first */
/* Add an array of regex of paths that shouldn't be cached */

First one is fairly straightforward, second and third are not and the syntax for regex paths is confusing to say the least.
/\/api\/.*/ is an example

I think it's best to just completely exclude the administrator directory. which i think would be this:
/\/administrator\/.*/

Has anyone seen or written a service worker with optimized caching for joomla? what should be network first, what should not be cached?