question

Upvotes
Accepted
6 4 3 4

.Subscribe Method with Cache

Hello,
when I call the Dex2 API from VBA with the .Subscribe method I can specify if it should use the cache or not (.Subscribe True or .Subscribe False).
Can anyone elaborate a bit on how the cache works?
Where is it stored exactly? How big can it get? How long is it kept? Is it stored per Instrument or per every single field?

I ask this because since I'm interested in fundamental data and historical prices, often a cached version is good enough (no need for real-data). But the next day, the latest, I would need again a fresh load. Many thanks!

eikoneikon-com-apiexcelvbacaching
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
39.4k 77 11 27

@nicola.pestalozzi
You're right. I'm not sure what I did wrong in my testing the other day. When I re-tested it today I saw the request going on the wire only if UseCache parameter in the Subscribe method is set to False. I was able to locate the cache files named cache.idx and cache_0 under %LOCALAPPDATA%\Thomson Reuters\Eikon User\Cache\<UUID>\
where the requests and the responses are cached. I was also able to dig out some description of how the cache is managed. You can find it by selecting Help - Thomson Reuters Eikon - Microsoft Office Help from Thomson Reuters tab in Excel ribbon and entering "fundamental data cache" in the search bar.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
39.4k 77 11 27

I don't think this parameter is used any more. Many years ago Dex2 library was implementing a caching mechanism and stored the cache in user profile on the desktop. But not any more. As far as I can see irrespective of the value of this parameter all requests are sent upstream. As this parameter was done away with the signature of the Subscribe method must have been kept the same to preserve backwards compatibility.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
6 4 3 4

Hi Alex,

I'm pretty sure this is still working because I can observe different behaviour when I set True or False after .Subscribe.
Some sort of caching *does* happen with .Subscribe True and I would like to understand how the mechanism work. Is there any documentation somewhere?
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I'm not aware of any documentation, but I'm very interested to learn where you see the differences. I ran a few tests using Fiddler yesterday before I posted my reply. What I saw was that no matter whether I set the parameter to True or False I see the same request going on the wire. This to me confirms that no caching is done on the local machine. If there was a local cache the second time I run the same request with .Subscribe(True), I'd expect the response to come from the cache and the request to not go on the wire. How did you test it and where did you see the difference?

Hi Alex, I see a considerable difference in the sourcing time when I set True for a repeated query. I just tried to source 20 attributes for 500 instruments with "False" and it took me almost 2 minutes. Repeating the operation with "True" took me less than 1 second. Repeating again with "False" took me about 30 seconds. By repeating again, the times remain stable (1 second vs. ~30 seconds). I cannot tell if the content effectively changed, but something makes a repeated query much faster (almost immediate) with "True".

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.