PostgreSQL: cache, disk, replication. What order?
PostgreSQL doesn't have a result cache. So the only caching that happens is in shared_buffers and the kernel buffer cache - both of which must inhertently be filled in the process of generating the query results, so it must happen before  (or while) results are sent.

WAL is written as a transaction executes, and WAL archives get replicated as they're filled. WAL records also get streamed over the streaming replication protocol as they're generated. So replication occurs during the execution of a query, but it's not as simple as "before" or "after" results are sent.

Results can be sent incrementally to the client. Replication can occur incrementally. Really, both happen at the same time.

The only guarantee is that a commit will not be replicated and applied to replicas before it commits on the master.

If you're using synchronous replication there is the additional guarantee that a committed transaction is replicated to all nodes before a successful commit is reported to the client.

I really think you're asking the wrong question here, though. You're making a bunch of assumptions and asking questions based on those assumptions. It would be helpful if you'd take a step back, to the why behind these questions, and explain what you are trying to achieve with this. What's your goal? What're your requirements? What outcome do you seek?