phonegap / phonegap-plugin-contentsync

Download and cache remotely hosted content
Apache License 2.0
206 stars 98 forks source link

iOS Aggresive Caching #141

Closed html-rulez-d00d closed 7 years ago

html-rulez-d00d commented 8 years ago

I noticed my file was not being updated correctly using the default options.type of replace. Seems a temporary form of remediation is to append a random string to the options.id, like so:

var sync = ContentSync.sync({ src: globals.url, id: 'test1'+new Date().getTime()+'.js'});
sync.on('progress',progressfn);
sync.on('complete',successfn);
sync.on('error',errorfn);

I'm surprised no one else is having this issue (or I'm missing something). At the very least, it is worth mentioning in the documentation to prevent people from getting snagged.

Issue witnessed on iPhone 5c (9.3.2) and iPhone 6 (9.3.5)

imhotep commented 8 years ago

This shouldn't happen as replace deletes the previous archive and extracts the new one. Are you seeing that your folder already exists in your Logs (in XCode) ?

html-rulez-d00d commented 8 years ago

@imhotep What version of iDevice are you using?

imhotep commented 8 years ago

I usually test on iPhone 5, 5S and 6+ on iOS 9.

html-rulez-d00d commented 8 years ago

This is only an issue on iOS devices for me. Android works perfectly fine. I'm not sure what to make of it outside of a persistent caching issue. I'm assuming you are testing on physical devices and not emulators? You could mark this issue "closed" and just add a blurb in your documentation stating if someone is having an issue with the file being replaced, to just append a random string to the id.

imhotep commented 7 years ago

Yes I test on physical devices