I noticed that a query on the stackoverflow data is cached after first execution. This is quite good, but how to force a re-execution? Since the underlaying data changed the query results are no more consistent with the present situation.
The data on data.stackexchange.com is "cached"; the data sets are updated once every week. Queries are not done against the live SE databases. See the data.se.com FAQ:
How frequently is Stack Exchange Data Explorer updated?
The data is updated early every Sunday morning around 3:00 UTC.
Query results are cached until the next dataset update, as the result of any one query and parameter combination is not going to change until then anyway.
While it's true that the general problem is that the data simply isn't live, the results of executing a query with a particular set of parameters absolutely are cached, and there isn't any way that normal users can purge them.
This can have some impact on the apparent correctness of the results if you use something in your query that's based on the current time, since after the first execution the selected reference point is locked in until that cache is cleared.
Since the data is only updated every month or so, though, it typically doesn't make sense to use the current time in your query at a granularity where it would be noticed anyway (i.e. the current day or hour). As such, the visible impact of the cache is quite insignificant*.
Currently, the cache will persist from the time that query is first run to the time that the cache is cleared manually. This manual purge is part of the process which updates the site statistics on the front page of the site, so you can be guaranteed that the cache will be cleared every time the underlying data is updated.
* However, if someone feels that there are cases where this isn't true, feel free to provide examples and I'll take a look