Caching limit for getInstruments

tfKamran
Calling getInstruments() or instruments web API too frequently is a waste of resources at both the ends.

If I had to cache the response of it, for how long will it be considered as safe to be cached?
  • tfKamran
    Assuming that I am only interested in instruments that are there since forever and remain listed forever.
  • vijoeyz
    I retrieve instruments only during weekends. I did not encounter any problems so far, although I currently trade only in equities. But for F&O, you might want to consider expiry date to determine if a new retrieval is required.
  • tfKamran
    Thanks. Even my use-case is just with equity.
  • sujith
    @tfKamran,
    It is updated every day. Sometimes when instruments are moved to T2T segment the tradingsymbol and instrument tokens change or when instruments are under ban then it won't be available for trading.
  • vijoeyz
    So, @sujith, what is the best time to download instruments? Before market hours or after hours of the day?
  • tfKamran
    @sujith Thanks. I include daily cache invalidation in my code then.

    I guess before the market hours would be the safest then?
  • rakeshr
    @vijoeyz @tfKamran
    Instrument master file is updated on the trading day's around 8 AM. Anytime post this should be fine.
This discussion has been closed.