Service Worker syntax for precache, network first, no cache

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
dmccreary663
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Sep 21, 2019 3:46 am

Service Worker syntax for precache, network first, no cache

Post by dmccreary663 » Fri Dec 06, 2019 10:03 pm

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?

Post Reply

Return to “Performance - Joomla! 3.x”