beacon icon indicating copy to clipboard operation
beacon copied to clipboard

Page Variants: render the same template on both dead and live requests

Open leandrocp opened this issue 1 year ago • 0 comments

Refreshing a page with variants may result in flashing elements due to rendering different templates between the dead and live requests. Once a template is defined in the dead request it should reuse the same template when it upgrades to live.

A possible solution to this problem is using https://hexdocs.pm/live_cache/LiveCache.html

To reproduce this bug: 1 - create a new page 2 - create one or more variants for that page 3 - publish the page 4 - visit that page 5 - hard refresh that page multiple times

You'll notice that sometimes it first loads a variant and after a second or less it loads another one (the difference between the dead and live render)

leandrocp avatar Aug 10 '23 18:08 leandrocp