I have few issues on caching...
1)I use URLImage as follows
URLImage.createToStorage(profileImg, photoUrl + "__c", photoUrl, URLImage.RESIZE_SCALE_TO_FILL)
But if the image is edited(old one is replaced with new one) in the server,it shows the old img instead of updating to the new image. what should i do to reupdate the cached image.
2)We are developing an news app. Here news are updated daily. The recent ten news are saved in the storage as follows:
//write the storage object
do {
Storage.getInstance().writeObject("newsListingStorage", fetchresponses);
} while (fetchLastId < 10);
//read the storage
public Vector newsListOfflineStorage() {
Vector newsListingRead = (Vector)Storage.getInstance().readObject("newsListingStorage");
return fetchresponses;
}
i am concerned that if a user stores 10 items each day, it'll store much more in a month or a year and the cache items goes on... How can i replace the cache stored every time to the latest 10 items so that there are only ten recent cached items every time one runs the app.