Avoid caching problems when using the API

Imagine a situation where you have an application that's doing the same mqlread over and over, and meanwhile someone else is changing the data, for instance via the Freebase.com UI or via another application.  Your app won't pick up those data changes.  How do you fix this?

The answer is to use the touch API service. This resets the mwLastWriteTime cookie to the current time. You can use either a POST (preferred) or GET method, which is permitted since some versions of Flash convert empty POSTs to GETs. When you use refresh cache in the developer toolbar you are using this service. As long as your agent is cookie-aware, you're guaranteed to not receive any response placed in cache prior to the most recent invocation of api/service/touch. Full details of the caching mechanism can be found in this Freebase blog post.

There's an archived post to the Developer's email list describing the entire process.

 

Search Help Center

Discussions

There are no conversations on this topic. Would you like to start one?

Start the Discussion »