Tag Archives: cache

Minor changes in TibiaData API

There have been a minor change to the TibiaData API regarding the gateway handling the requests.

Earlier, we’ve been using Nginx as handler of the requests, but we have successfully switched to Kong API Gateway instead. This is a first step into upcoming changes..

There are two things we would like to highlight so far.

  1. New headers related to caching by Kong
    API requests are cached in Kong API gateway instead of inside the application and with that there come a few benefits.
    Two new headers that are in place which could be nice for you to know more about:
    • Age – shows the age of the page in seconds (not presented if its not cached)
    • X-Cache-Status – identifies the status of the request’s proxy cache
      • Miss – the request was satisfied by being proxied upstream and parsed fresh data from tibia.com
      • Hit – the request was satisfied and served from cache
      • Bypass – the request could not be satisfied by the cache
  2. Response about page not found/no route existing
    • Earlier behavior, you where presented with a page not found page.
    • New behavior, you will either get a page not found or a JSON response saying there is no route.
    • Future change, you will later on only use JSON responses all the way.

If you want to know more, what the cache intervals are for the different endpoints, you can read our post about TibiaData cache intervals.

Please get in touch with us if you are experiencing any issues and we can try to resolve those.

Regards,
Tobias


TibiaData cache intervals

I’ve received a lot of questions regarding realtime data and the cache we use on our side.. so I thought that I will give you some more details!

As from v2 of the API, we’ve implemented a cache, to minimize the resources that we use in for example CPU usage and to lower the amount of requests that poll our service on a seconds bases.
We at TibiaData understand that you want the latest latest data, but when receiving that amount of similar requests, we had to limit it somehow.

The cache we use is a memcached daemon, which stores data in the memory to serve the information faster to you.

Here is a list of the different API requests and the corresponding memcached timeouts.

  • Characters = 300 s
  • Guild/Guilds/Guildwars = 120 s
  • Highscore = 900 s
  • House/Houses = 300 s
  • News/Newslist = 900 s
  • World/Worlds = 60 s

Do you want to contribute with some money to our project? 
Here you can find our PayPal pool for TibiaData:
https://paypal.me/pools/c/7ZbFeDdXZ6

Best regards,
Tobias Lindberg