Skip request level caching of objects if there is no request
Description
If something is triggered in the background e.g. related to events and a page move, the execution does not run within a request at least based on the following stacktrace:
The ThreadLocal we are using is cleaned-up via a filter and in such a case this doesn't happen and the cached value stays until a next request is cleaning up the entry.
Maybe the best would be to avoid the caching if we are not running as part of a request.
If something is triggered in the background e.g. related to events and a page move, the execution does not run within a request at least based on the following stacktrace:
The ThreadLocal we are using is cleaned-up via a filter and in such a case this doesn't happen and the cached value stays until a next request is cleaning up the entry.
Maybe the best would be to avoid the caching if we are not running as part of a request.