<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="198365" data-post-id="198365">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cnck1387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cnck1387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Phoenix-Core-Team" data-username="chrismccord" data-post="11" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/48/24233_2.png" class="avatar"> chrismccord:</div>
<blockquote>
<p>This isn’t quite right. On broadcast side, your system can broadcast a generic “Tweet Updated” event, and then LiveView will surgically send the diffs based on what changed without any work for the dev – rt count, likes, body, etc.</p>
</blockquote>
</aside>
<p>Right, good call on that. I had glanced at something like 9 hours ago thinking there was only 1 endpoint in the Rails example I looked at and now looking back I see there’s multiple ones like you described.</p>
<p>I’ll leave my original comment there so the discussion makes sense.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198365" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-198365" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198365"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="198366" data-post-id="198366">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cnck1387" data-post="10" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/2bfe46/48.png" class="avatar"> cnck1387:</div>
<blockquote>
<p>I don’t know it well enough to answer this question with certainty but I’m pretty sure DHH mentioned this in the video. If you access a frame for a 2nd time and the content didn’t change the server will respond with a 304 content not modified and you can use the cached version.</p>
</blockquote>
</aside>
<p>That’s not quite what I am referring to. I am rather referring to the same frame being instantiated multiple times. For example, take each message in a chat app. In an actual app each message has a lot of markup around it. How do make sure you send only the actual message and not all of the markup multiple times? This is what a SPA would give you - which is the standard LV is typically being held at - and also what LV and React Server Components give.</p>
<p>Or building on your tweets example. On Twitter UI, you almost never load tweets one by one. You either: load a page with a bunch of tweets or you click the “Show latest 10 tweets” banner. In both cases, you’d send the markup of each tweet multiple times with Hotwire.</p>
<p>And HTTP caching is not something that will help you here either. That’s because:</p>
<ol>
<li>
<p>The request either has a bunch of tweets (the whole page or the next 10 tweets) - a combination unlikely to repeat over a request again</p>
</li>
<li>
<p>You will cache each individual tweet. But if you are caching it with HTTP, then it means you need to do an individual request to load each tweet and if clicking “Show latest 10 tweets” translates into 10 HTTP requests, that’s going to be way too expensive.</p>
</li>
</ol>
<p>EDIT: to take yet another example: live form validation. You won’t benefit from HTTP caching at all as you receive feedback - so if you don’t want to send the whole form over and over again as the user types in or blurs an input, sending only the dynamic parts is essential. And I think that will generally hold for anything interactive/realtime.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198366" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-198366" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198366"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="198373" data-post-id="198373">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="derek-zhou" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/120/19943_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  derek-zhou
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="13" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>How do make sure you send only the actual message and not all of the markup multiple times?</p>
</blockquote>
</aside>
<p>With all the HTTP headers and auth per request, it probably will not make much difference anyway. I’d say just send the markup. I agree that in the applications you cited, like chat, twitter or live form validation LV is the better choice. For applications that is not so real time, such as <a href="http://Hey.com" rel="noopener nofollow ugc">Hey.com</a>, basecamp, or this forum, it could make a lot of sense.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198373" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-198373" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198373"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="198377" data-post-id="198377">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cnck1387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cnck1387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="13" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>In an actual app each message has a lot of markup around it. How do make sure you send only the actual message and not all of the markup multiple times?</p>
</blockquote>
</aside>
<p>From what I gathered, your frame would be the list of messages and they would be listed out as if it were an HTML response from the server without anything extra going on. If you had 5 messages that would mean having 5 messages each with their own HTML tags associated to them.</p>
<p>It’s not as sophisticated as merging in dynamic content into the static parts of a template like LV does. But we’re also dealing with a day 1 release. Who knows what will happen later.</p>
<p>I’m not too concerned about identical HTML being duplicated because gzip is remarkably efficient to the point where you almost can’t believe how well it can reduce lots of repeated text down into a few characters.</p>
<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="13" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>The request either has a bunch of tweets (the whole page or the next 10 tweets) - a combination unlikely to repeat over a request again</p>
</blockquote>
</aside>
<p>In this twitter example sure, but in a lot of apps I could see cache hits being the norm. Such as a list of lessons in a table of contents, forum threads in a non-super busy forum, the 5 latest blog posts, etc.. Basically what <a class="mention" href="/u/derek-zhou" rel="nofollow">@derek-zhou</a> said.</p>
<p>If you haven’t watched it already, <a href="https://youtu.be/eKY-QES1XQQ?t=585" rel="noopener nofollow ugc">the last ~3 minutes</a> of DHH’s demo video gives a glimpse at how these patterns are applied to Hey. It looked like lots of opportunities for cache hits and it shows when they situationally bring in websockets (Turbo Streams) to offer soft real-time broadcasted updates.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198377" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-198377" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198377"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="198384" data-post-id="198384">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="14" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>I agree that in the applications you cited, like chat, twitter or live form validation LV is the better choice.</p>
</blockquote>
</aside>
<aside class="quote no-group" data-username="cnck1387" data-post="15" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/2bfe46/48.png" class="avatar"> cnck1387:</div>
<blockquote>
<p>In this twitter example sure, but in a lot of apps I could see cache hits being the norm.</p>
</blockquote>
</aside>
<p>That’s precisely my point. I didn’t bother about HTTP caching rendered content on any Phoenix app I wrote because:</p>
<ol>
<li>
<p>They all felt fast naturally</p>
</li>
<li>
<p>Rails default HTTP caching - the one used in the video - is the digest of the HTTP response. This means you still do all work on the server, the database, and in rendering a response. So if a response is slow to render in the first place, the cache won’t really help you, as the only part it skips is the sending of the data</p>
</li>
<li>
<p>Compression, turbolinks, live links, and others reduce the content size anyway</p>
</li>
<li>
<p>Small bits of interactivity that we add, such as flash messages, makes HTTP caching generally difficult</p>
</li>
</ol>
<p>You can implement more efficient HTTP caching by writing custom code but given points 1, 3 and 4, I would rather put the development effort elsewhere. If I have to cache, I would do it within the app as it provides more granularity.</p>
<p>On the other hand, live form validation is something I would have used on every app that I have built in my entire life - and without content diffing it isn’t really practical. So to me, when it comes to practice, we are talking about a feature with marginal benefits vs a must have.</p>
<p>EDIT: of course, HTTP caching is still great for static assets and places where you can compute digests upfront (without doing the work).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198384" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-198384" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198384"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="198390" data-post-id="198390">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cnck1387" data-post="15" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/2bfe46/48.png" class="avatar"> cnck1387:</div>
<blockquote>
<p>I’m not too concerned about identical HTML being duplicated because gzip is remarkably efficient to the point where you almost can’t believe how well it can reduce lots of repeated text down into a few characters.</p>
</blockquote>
</aside>
<p>You are right. I did some tests to see how efficient it is and gzip pretty much removes all of the duplicated content. So when you are sending the same content multiple times in the same payload - it covers it. This is great to know because the dead render in LV does not remove duplicated content and I was wondering how to address it. But apparently I don’t have to worry about it at all.</p>
<p>There is still one case left: when you are streaming messages one by one, such as in chat, you would be sending the same markup every time there is a new message. As they are distinct payloads, gzip won’t help. And there is no HTTP caching here either unless you load each individual message with a separate request.</p>
<p>So to sum up my thoughts so far:</p>
<ol>
<li>gzip takes care of minimizing payloads and duplicate content on the same render</li>
<li>digest based http caching provides minimal benefits for rendered content - to the point it is not something I would worry about optimizing for</li>
<li>a stateful connection + change tracking is a requirement for the interactive bits</li>
<li>static/dynamic splitting reduce payloads on realtime updates (where gzip doesn’t apply)</li>
</ol>
<p>I can be convinced that 4 is a nice to have - although it is a requirement if you want to compete with SPAs - but 1 and 3 are must haves. I am not giving up on my hard earned live form validations and general interactivity. <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198390" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-198390" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198390"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="198410" data-post-id="198410">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cnck1387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cnck1387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="17" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<ul>
<li>gzip takes care of minimizing payloads and duplicate content on the same render</li>
</ul>
</blockquote>
</aside>
<p>On a related note can you even gzip websocket transmissions? I don’t think it’s supported yet by browsers, and I can’t find any docs on nginx’s site about it</p>
<p>Just asking because if you use LV for everything to benefit from page transitions like turbolinks then aren’t you technically sending a very large amount of HTML over a websocket connection that won’t be gzipped?</p>
<p>Use case:</p>
<p>You have a list of blog posts and everything within the main page content results in having 80kb of HTML.</p>
<p>You click a specific blog post and transition to a blog show page with 100kb of HTML to show the blog post itself.</p>
<p>You do that navigation with <code>live_redirect</code> to benefit from keeping the <code>&lt;head&gt;</code> along with some of the nav bar and maybe footer around in the DOM so only the main page content changes.</p>
<p>I know diff tracking is great for things like validation where only a tiny bit of text changes, in which case gzip isn’t super important but for nearly full page transitions you’re dealing with tens, or possibly even hundreds of kb of HTML that can’t be gzipped.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198410" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-198410" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198410"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="198414" data-post-id="198414">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cnck1387" data-post="18" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/2bfe46/48.png" class="avatar"> cnck1387:</div>
<blockquote>
<p>On a related note can you even gzip websocket transmissions? I don’t think it’s supported yet by browsers, and I can’t find any docs on nginx’s site about it</p>
</blockquote>
</aside>
<p><a href="https://tools.ietf.org/html/rfc7692" rel="nofollow">Yes</a>. Set <code>compress: true</code> option for your websocket configuration in the endpoint and you are good to go.</p>
<p>Note that LiveView will also do the static/dynamic and content tracking even on live_redirect. So data inside comprehensions or components is sent only once. So you are getting both LV optimizations and gzip.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198414" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-198414" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198414"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="198419" data-post-id="198419">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="derek-zhou" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/120/19943_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  derek-zhou
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cnck1387" data-post="18" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/2bfe46/48.png" class="avatar"> cnck1387:</div>
<blockquote>
<p>Use case:</p>
<p>You have a list of blog posts and everything within the main page content results in having 80kb of HTML.</p>
<p>You click a specific blog post and transition to a blog show page with 100kb of HTML to show the blog post itself.</p>
<p>You do that navigation with <code>live_redirect</code> to benefit from keeping the <code>&lt;head&gt;</code> along with some of the nav bar and maybe footer around in the DOM so only the main page content changes.</p>
</blockquote>
</aside>
<p>Using liveview for a blog is probably not so smart. On the other hand, liveview and turbo can work side by side:</p>
<ul>
<li>using LV on websocket for the chat window, news ticker, live forms, etc</li>
<li>using turbo on regular HTTP for infinite scroll, user navigation, etc</li>
</ul>
<p>All on the same page. That will be sweet.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198419" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-198419" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198419"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="198421" data-post-id="198421">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cnck1387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cnck1387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="19" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>Set <code>compress: true</code> option for your websocket configuration in the endpoint and you are good to go.</p>
</blockquote>
</aside>
<p>Does that mean both gzipping and unzipping happens in Elixir code instead of nginx or another reverse proxy? Is it implemented in a way that supports all LV supported browsers? It looks like there’s been a bunch of different headers that various browsers expect. With HTTP this is something that nginx would usually handle.</p>
<p>As recent as 2020, it looks like maybe Safari doesn’t support the official spec based on comments in <a href="https://stackoverflow.com/a/45561784" rel="noopener nofollow ugc">https://stackoverflow.com/a/45561784</a>.</p>
<aside class="quote no-group" data-username="derek-zhou" data-post="20" data-topic="36390">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>Using liveview for a blog is probably not so smart.</p>
</blockquote>
</aside>
<p>That opens a can of worms of needing to drag in both JS libs and have them play nice together. The trade off there are increasing your bundle size and also increasing the complexity. I’ve also seen Chris and others say to LV all the things (in the context of creating an app where it makes sense, like not needing offline support, etc.).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198421" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/hotwire-by-basecamp/36390/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-198421" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198421"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/36390/load_more?page=3">Load more posts (2 remaining)</a>
</div></template></turbo-stream>