Since I release of HTTP caching libraries for Elixir and particularly plug_http_cache, the most frequent question has been if it’s possible to cache Liveviews. Why caching Liveviews The first reason is SEO, that is to speed up page loading to get a better page ranking. Search engines take into account many parameters, including the Time To First Byte which is why caching is important for some Phoenix apps. Although you can theoretically develop some pages with Liveview (not cacheable until ...| Posts on Tangui's blog
In the previous article, we discussed how to setup plug_http_cache to cache Phoenix’s response. In this article, we’ll take a look at the specific case of caching when doing A/B testing. A/B testing consists in presenting 2 different versions of a page (page A and page B) to users and comparing the users’ behaviour to determine which version performs better. Usually, a user is randomly assigned a group (A or B) when first visiting the site implementing A/B testing and sticks to this gro...| Posts on Tangui's blog
In Part 1: The road to HTTP-caching Liveviews, we’ve succeeded in caching the initial rendering of Liveviews. For this we had to: disable CSRF token check, using a modified version of Phoenix disable sending the CSRF token when establishing the websocket connection configure a Plug that sets the cache-control header and eventually configure PlugHTTPCache So far we succeeded in caching Liveviews that render public content. Caching private content with plug_http_cache or a CDN makes little se...| Tangui's blog