@@ -33,6 +33,20 @@ defmodule ComponentsGuideWeb.LatencyComparisonLive do
33
33
def get_fastest_slowest_responses ( % __MODULE__ { responses: responses } ) do
34
34
Enum . min_max_by ( responses , fn response -> response . timings . duration end )
35
35
end
36
+
37
+ def get_headers_of_interest ( % Fetch.Response { } = response ) do
38
+ h = response . headers
39
+ content_length = Enum . find ( h , fn { key , _ } -> String . downcase ( key ) == "content-length" end )
40
+ content_encoding = Enum . find ( h , fn { key , _ } -> String . downcase ( key ) == "content_encoding" end )
41
+ transfer_encoding = Enum . find ( h , fn { key , _ } -> String . downcase ( key ) == "transfer-encoding" end )
42
+ cache_control = Enum . find ( h , fn { key , _ } -> String . downcase ( key ) == "cache-control" end )
43
+ inspect ( [
44
+ content_length ,
45
+ content_encoding ,
46
+ transfer_encoding ,
47
+ cache_control
48
+ ] )
49
+ end
36
50
end
37
51
38
52
@ impl true
@@ -53,7 +67,7 @@ defmodule ComponentsGuideWeb.LatencyComparisonLive do
53
67
< output form = "latency_comparison_form " class = "flex flex-col gap-4 pt-4 max-w-none text-center " >
54
68
<%= for response <- @ state . responses || [ ] , response != nil do %>
55
69
< div class = "p-4 text-white bg-black font-mono " >
56
- < pre class = "bg-transparent " > <%= response . url %> </ pre >
70
+ < pre class = "bg-transparent " title = { State . get_headers_of_interest ( response ) } > <%= response . url %> </ pre >
57
71
< div class = "my-1 flex justify-center " >
58
72
< div class = "h-1 bg-yellow-200 " style = { "width: #{ System . convert_time_unit ( response . timings . connected , :native , :millisecond ) } px" } > </ div >
59
73
< div class = "h-1 bg-green-500 " style = { "width: #{ System . convert_time_unit ( response . timings . received_status - response . timings . connected , :native , :millisecond ) } px" } > </ div >
@@ -146,6 +160,8 @@ defmodule ComponentsGuideWeb.LatencyComparisonLive do
146
160
"https://blog.cloudflare.com/rss/" ,
147
161
"https://vercel.com/blog" ,
148
162
"https://vercel.com/atom" ,
163
+ "https://tailwindcss.com/blog" ,
164
+ "https://tailwindcss.com/feeds/atom.xml" ,
149
165
"https://fly.io/blog" ,
150
166
"https://fly.io/blog/feed.xml" ,
151
167
"https://render.com/blog" ,
0 commit comments