kadirahq / fast-render

Render you app even before the DDP connection is live. - magic?
MIT License
560 stars 80 forks source link

Caching issues, and waiting for "real" (i.e. not fast-rendered) data #175

Open SachaG opened 7 years ago

SachaG commented 7 years ago

The way fast-render works is that it "tricks" Mini-mongo into thinking data is loaded right from the start, before Meteor ever subscribes and gets its data via the normal DDP channel.

But I'm running into an annoying issue: I want to cache my pages via Nginx, meaning the fast-render part of the initial payload will also be cached.

This means there might be discrepancies between the fast-render data and the "real" DDP data. That's not a huge problem since any discrepancy will self-correct reactively once the DDP data kicks in, but it does lead to a few issues in my app.

So I would love to know if there's any way to test for when a subscription is "really" ready, in the sense that it's receiving its data via DDP and not from fast-render?

Alternatively, any recommendation for handling caching and fast-render together?