I am currently using nextJS (with react) and its working great. I am also using data prefetch link to prefetch links within the application and it works awesome.
I have a requirement to prefetch couple of pages created using nextJs but running as a separate application. I tried using rel=prefetch / rel=next tag and those work fine on chrome and firefox but it looks like safari doesn't support prefetch tags.
I then tried using npmjs package but even this couldn't force safari to use the page from disk cache. The interesting part is, I can see the prefetch (via fetch) calls going in network tab on safari (on page load) but when I click the target html link it still gets the data from network and not from disk cache.
I also tried using service workers cache api methods to see if that would force safari to render page from cache and I can see the fetch calls happening but safari is not using the data from cache when I click the target URL.
render(){
const cacheName = 'testcache';
const deviceURL = this.props.device.PDPPageURL.toString().replace(/^.*\.com/g, "");
if(typeof(window) !== 'undefined' && window){
if ('caches' in window) {
caches.open(cacheName).then(cache => {
cache.add(deviceURL).then(() => {
console.log('\n Apple urls Added to cache ');
});
});
}
Is there a workaround to implement this requirement across all browsers?