You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
I've taken this file and rewritten it so that it doesn't use PouchDB at all but uses a simple synchronous in memory storage system.
The reason for this is that I use HERE maps with the traffic tiles and any tile over two mins old is out of date anyway, but I wanted the caching facility to reduce network usage and to speed things up. So there was no need to cache things long term (more than two mins), no need to sync data and PouchDB is complete overkill for my needs.
The core of the code is basically the same as before so I cannot take much (any?) credit for this. I have simply removed the PouchDB requirements and substituted my own calls to my own SimpleDB prototype. The API has stayed the same, e.g. so the call to
if (existingRevision) {
this._db.remove(tileUrl, existingRevision);
}
this._db.put(doc, tileUrl, doc.timestamp);
is still the same call but now it calls my versions of the code for db.remove and db.put and not PouchDB. All I have done is mimic the PouchDB API calls to get, put and remove to my own calls which use a simple array to store the data. It still uses callbacks but not bothered with promises as this code doesn't use them :)
A couple of updates we have made is that we modify the URL called. We strip out the subdomain that HERE maps uses (1,2,3,4) when we store the data as the sub domains are just used for speed. Keeping the subdomains in, means we store four times the data, reduce the caching efficiency, 4x the network bandwidth etc etc. This modification is invisible to the user, so the user still calls the with the full URL and not the stripped down one.
It seems to work very well for our apps, so we will use our SimpleDB instead of PouchDB. We wondered if anybody else needed our code. Since we only simulated the PouchAPI calls, 95% of the code here is the same so we can't take much credit.
The other main advantage is that you no longer get PouchDB conflict errors as the code never has this problem :)
So please let me know if there is any interest, the code is pretty simple and we can put up a new fork on Github if necessary.
Thanks
Rob
The text was updated successfully, but these errors were encountered:
Ok, no worries, if you encounter some limitation to do that, let me know and I could look at the code and try to understand the changes (if you don't mind) =) Thanks!
Hi,
I've taken this file and rewritten it so that it doesn't use PouchDB at all but uses a simple synchronous in memory storage system.
The reason for this is that I use HERE maps with the traffic tiles and any tile over two mins old is out of date anyway, but I wanted the caching facility to reduce network usage and to speed things up. So there was no need to cache things long term (more than two mins), no need to sync data and PouchDB is complete overkill for my needs.
The core of the code is basically the same as before so I cannot take much (any?) credit for this. I have simply removed the PouchDB requirements and substituted my own calls to my own SimpleDB prototype. The API has stayed the same, e.g. so the call to
is still the same call but now it calls my versions of the code for db.remove and db.put and not PouchDB. All I have done is mimic the PouchDB API calls to get, put and remove to my own calls which use a simple array to store the data. It still uses callbacks but not bothered with promises as this code doesn't use them :)
A couple of updates we have made is that we modify the URL called. We strip out the subdomain that HERE maps uses (1,2,3,4) when we store the data as the sub domains are just used for speed. Keeping the subdomains in, means we store four times the data, reduce the caching efficiency, 4x the network bandwidth etc etc. This modification is invisible to the user, so the user still calls the with the full URL and not the stripped down one.
It seems to work very well for our apps, so we will use our SimpleDB instead of PouchDB. We wondered if anybody else needed our code. Since we only simulated the PouchAPI calls, 95% of the code here is the same so we can't take much credit.
The other main advantage is that you no longer get PouchDB conflict errors as the code never has this problem :)
So please let me know if there is any interest, the code is pretty simple and we can put up a new fork on Github if necessary.
Thanks
Rob
The text was updated successfully, but these errors were encountered: