尝试在Service Workers中缓存Google Maps API响应。
源代码:https://github.com/boopathi/sw-demo-iss/blob/gh-pages/sw.js 我现在正在使用所有Maps API请求的URL,但这似乎是不好的方法,而且我无法缓存所有内容。我能否缓存某些类型的请求并响应相同类型的请求?
例如,
源代码:https://github.com/boopathi/sw-demo-iss/blob/gh-pages/sw.js 我现在正在使用所有Maps API请求的URL,但这似乎是不好的方法,而且我无法缓存所有内容。我能否缓存某些类型的请求并响应相同类型的请求?
例如,
GET maps.googleapi.com/js?param1=value1
#and
GET maps.googleapi.com/js?param2=value2¶m3=value3
能否将此内容缓存为'maps.googleapi.com/js'
并在获取时注入上次使用的参数?