scitedotai / scite-zotero-plugin

scite zotero plugin
596 stars 27 forks source link

No caching of results #24

Open andrusha opened 3 years ago

andrusha commented 3 years ago

On each Zotero startup the scite plugin fetches the tallies for all the papers, this is nice to have most recent numbers, but put quite a bit of strain on the network. It would be nice to have the values cached with the ability to manually trigger refresh.

u-ashish commented 3 years ago

Hi @andrusha

Thanks for creating this issue -- I've thought about this before but never got around to implementing it.

Let's say that Zotero does cache some of them after the initial load and you close it -- if you open it up a few days later and wanted to do a refresh, right now the plugin only lets you refresh individual rows. How would you want to be able to bulk refresh? Just a button to refresh all tallies? Or grouped selections?

andrusha commented 3 years ago

Thanks for the quick response!

I think the answer is yes, and judging by the other plugins, implementing item-processing for selection / all items / collection is pretty straight-forward once you have the method to work on arrays.

Here is an example of this functionality from scihub integration (code a bit convoluted, but you get the gist): https://github.com/ethanwillis/zotero-scihub/blob/master/chrome/content/overlay.xul#L27-L45 https://github.com/ethanwillis/zotero-scihub/blob/master/chrome/content/scripts/zoteroscihub.js#L47-L70

To me it seems the harder part would be working with the state storage, I wonder if it's possible to attach citation numbers as the field on the item.

andrusha commented 3 years ago

Maybe extra field could be used https://www.zotero.org/support/kb/item_types_and_fields#citing_fields_from_extra

hbzhou530 commented 2 years ago

Thank you for your work. May I ask if this plugin API has adopted a CDN suitable for China? I am sure when I used it today, No scite tallies because of internet connection problems. But it was normal 12 hours ago.

u-ashish commented 2 years ago

Hi @hbzhou530 -- we do have a CDN and caching, I think there may have been some performance issues on the API over the weekend that should be resolved now. Is this still happening for you? Maybe you can check over the next few days and report back?

hbzhou530 commented 2 years ago

@u-ashish Now it works properly. Thanks.