Closed distantnative closed 4 months ago
About preloading: I don't think it makes sense to preload all playground stories when visiting the homepage, but we could make it a bit faster by preloading the main story image immediately in the switchTo
method when a new story is loaded.
Could work like this:
data-image
attribute to the link in the menu.fetch
request for the HTML, do a new Image().src = url;
to preload the image in the background.@lukasbestle I am also thinking if there would be a better way than fetch the whole home page when switching, just to extract the playground part. Maybe we could work with a content representation here that only return the playground part?
Made some additional enhancements to reduce flickering. I think we could merge it like this already, check the results in production and optimize further if needed. I feel like reducing the HTML payload would bring us a tiny improvement compared to the added complexity as it's just text and normal pages load quickly.
I still experience sometimes the flicker. But it's the same on the old version. So still purely improvement. I agree on merging already and tweaking further later.