XF 2.2 What is this page/json request for? '/index.php?sw/cache.json'

rdn

Well-known member
xf222.com/index.php?sw/cache.json

I ask because it's requested on most page view and maybe I can cache it for all users?
Thanks.
 
It shouldn't be requested on most page views, but it is part of the service worker setup so it's something that would be requested by new sessions (and when style-related data changes). This response defines the resources that may be used by the "you're offline" message that PWAs need to handle, though by default we don't define any external resources. In future, it may be expanded to provide a list of resources to more generally cache.
 
It can in theory be unique to the user (as it might differ depending on the style they are using), though as it stands, it's not, so you should be able to aggressively cache it.
 
  • Love
Reactions: rdn
Back
Top Bottom