evernote-random
evernote-random copied to clipboard
Lessen use of getUserUrls
Per Evernote API team:
Looking at our logs, I'm seeing an abnormal number of calls for
getUserUrls
- 380 calls for a single user. I'd recommend caching the result for a user, the result of that call is unlikely to ever change.
getUserUrls
evernote doc: http://dev.evernote.com/doc/reference/UserStore.html#Fn_UserStore_getUserUrls
Likely called by getNoteStore()
in the evernote
library https://github.com/evernote/evernote-sdk-js/blob/master/src/client.js#L105-L110
What we can do is:
- In
server/controllers/notes.js
havenotebooks()
andrandomNote()
functions accept anoteStoreUrl
param - pass that into calls toclient.getNoteStore(noteStoreUrl)
(here and here) - If
req.session.noteStoreUrl
exists use it and pass it to those functions - otherwise call a function to obtain it, store it in the session