Support » Plugin: Open Currency Converter » Cache Exchange Conversion

  • Question about how caching works.

    Added 10 shortcodes to convert currency on a single post: 1 x USD to KRW, 8 x KRW to USD, 1 x USD to COP.

    The post is not published yet but so far 15 API requests appear on openexchangerates.org only from testing. The Exchange Rates Cache is set to 900 (cannot go above 1000 but only need to check exchange rates 1x per day).

    Is each set of exchange rates cached, i.e. USD to KRW, KRW to USD, USD to COP for a total of 3? Or, is each shortcode instance cached for a total of 10? Or, some other calculation?

    My original assumption was the exchange rates are requested via API once per cache period and every conversion calculation is performed without further API requests. Otherwise, the number of API requests will be significant, but that does not seem to be the case.

    What is the proper calculation to estimate how many API requests if for example 10 views (per day, per post) on 5 posts with 10 convert shortcodes (per post)?

    Thanks for the help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Artiss

    (@dartiss)

    Hi,

    If I remember correctly, I don’t use the cache when you preview the ticket (to ensure that it’s always shown as the latest, correct, figure). Otherwise, it should be one cache per shortcode.

    Thanks for the quick reply. No cache on preview makes sense. One cache per shortcode should be okay. Will follow up once published if API requests are higher than expected.

    Plugin Author David Artiss

    (@dartiss)

    Sure. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.