Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lessen use of getUserUrls #14

Open
galtenberg opened this issue Nov 17, 2017 · 1 comment
Open

Lessen use of getUserUrls #14

galtenberg opened this issue Nov 17, 2017 · 1 comment

Comments

@galtenberg
Copy link
Owner

galtenberg commented Nov 17, 2017

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

@galtenberg
Copy link
Owner Author

galtenberg commented Nov 17, 2017

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 have notebooks() and randomNote() functions accept a noteStoreUrl param - pass that into calls to client.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant