In Aura components we used to call action.setStorable() on the client side. For LWC (and optionally Aura) we now cache query results by setting @AuraEnabled(cacheable=true) on the server side.
Is the behavior / algorithm used by cacheable=true outlined anywhere? The documentation on the @AuraEnabled annotation provides the following vague information.
Marking a method as storable (cacheable) improves your component’s performance by quickly showing cached data from client-side storage without waiting for a server trip. If the cached data is stale, the framework retrieves the latest data from the server.
The docs on the lifecycle on storable Aura actions are more detailed and outline the possibility that the callback executes twice if it's a cache hit that requires a refresh. I'm wondering if those same rules apply to Aura actions that call an @AuraEnabled(cacheable=true) method, and if the same rules apply to wire service when the adapter is an Apex method.