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.
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
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.
There have been a minor change to the whole TibiaData API regarding CORS (Cross-Origin Resource Sharing).
This means, that you now can run requests with for example ajax towards the API right from your website.
The allowed HTTP methods are GET and OPTIONS.
Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own.