<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>I Read This Week - ireadthisweek</title><link>https://www.ireadthisweek.com/author/ireadthisweek</link><description>What ireadthisweek read about this week</description><atom:link href="https://www.ireadthisweek.com/author/ireadthisweek/rss" rel="self" type="application/rss+xml"></atom:link><item><title>I Read This Week - ireadthisweek - 2022-12-31</title><link>https://www.ireadthisweek.com/author/ireadthisweek/post/2022/12/31</link><guid>https://www.ireadthisweek.com/author/ireadthisweek/post/2022/12/31</guid><description># New Feature - Email to Blog Post&#xA;Now when you send an email to your special email address and start the&#xD;&#xA;subject with “blog: “ or “title: “ a title will be prepended to your&#xD;&#xA;blog post and it will become a midweek blog post.&#xD;&#xA;&#xD;&#xA;After the email is sent the blog post will be immediately published&#xD;&#xA;and sent to your subscribers via email in a newsletter format.&#xD;&#xA;&#xD;&#xA;The word “blog: “ or “title: “ including colon and optional space will&#xD;&#xA;be removed and everything that comes after it will be the title of&#xD;&#xA;your blog post.&#xD;&#xA;&#xD;&#xA;So if the subject line of your email is “blog: Here are Seven Great&#xD;&#xA;ways to Write Better” then the title will be “Here are Seven Great&#xD;&#xA;ways to Write Better” and the body of the email will be the body of&#xD;&#xA;your blog post. It will then be published and sent out immediately to&#xD;&#xA;your subscribers.&#xD;&#xA;&#xD;&#xA;This won’t be recorded in your weekly post and that will continue on&#xD;&#xA;as normal, accumulating emails and auto publishing once a week.&#xD;&#xA;</description></item><item><title>I Read This Week - ireadthisweek - 2022-02-14</title><link>https://www.ireadthisweek.com/author/ireadthisweek/post/2022/02/14</link><guid>https://www.ireadthisweek.com/author/ireadthisweek/post/2022/02/14</guid><description># ​​The Raw Speed of the Web&#xD;&#xA;&#xD;&#xA;When you optimize for speed over everything else the web can get pretty fast.&#xD;&#xA;&#xD;&#xA;The trick is in 2022 to manage or pay attention to everything that your page has in it. Everything that the server sends to the browser can be measured.&#xD;&#xA;&#xD;&#xA;We’ll be taking a look at this page:&#xD;&#xA;&#xD;&#xA;![screenshot-of-page](https://wsnd.io/2f5aSNNX/screenshot-of-page.png)&#xD;&#xA;&#xD;&#xA;In order to send this page to the browser a request was made. Then the browser received it’s response from the server, in this case it was an HTML page.&#xD;&#xA;&#xD;&#xA;![image-of-timeline-download](https://wsnd.io/1KqVb2dX/image-of-timeline-download.png)&#xD;&#xA;&#xD;&#xA;This HTML page told us to download these additional elements, namely these images and css from the same site and a couple of images from other sites&#xD;&#xA;&#xD;&#xA;![pie-chart-of-time-spent](https://wsnd.io/v3JAc7Hc/pie-chart-of-time-spent.png)&#xD;&#xA;&#xD;&#xA;Some of the images and css were downloaded in parallel which saved time.&#xD;&#xA;&#xD;&#xA;![all-timeline-view](https://wsnd.io/zbCe916T/all-timeline-view.png)&#xD;&#xA;&#xD;&#xA;For some sites literally every item has to show up before anything can be rendered. But for this page the rendering happens as soon as the HTML is loaded, so while the browser times how many milliseconds it takes to finish loading our reader can start reading as soon as text shows up on the screen. &#xD;&#xA;&#xD;&#xA;For human perception most anything that happens below [13ms is perceived as instantaneous](https://caseguard.com/articles/how-many-frames-per-second-can-the-human-eye-see/). But anything that happens below 100ms is “almost instantaneous” and that’s our target for webpages, almost instantaneous.&#xD;&#xA;&#xD;&#xA;So how fast does this page load? The browser reports this page loads in around 127ms (milliseconds) and the total time is 140ms. So I tried checking the time with a stopwatch but my hand reaction time wasn’t fast enough, I was reacting in around 390ms, but I could perceive that it did take some amount of time. Thankfully I had a high speed camera via my smartphone, I could record a high speed video and count how many frames it took in between pressing enter and the rendering to finish. The video frame rate is 240fps (frames per second) and the number of frames it took to display is approximately 83. So this means the page took around 346ms to display, my reaction time was pretty close but the eye (and brain) is actually faster than the hand.&#xD;&#xA;&#xD;&#xA;Right before enter is pressed&#xD;&#xA;&#xD;&#xA;![531](https://wsnd.io/ARI6cr9j/531.jpg)&#xD;&#xA;&#xD;&#xA;Right after enter is pressed&#xD;&#xA;&#xD;&#xA;![533](https://wsnd.io/qru1zNCW/533.jpg)&#xD;&#xA;&#xD;&#xA;The first visual indicator appears in the toolbar&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;The browser starts painting&#xD;&#xA;&#xD;&#xA;![583](https://wsnd.io/VDjozhE6/583.jpg)&#xD;&#xA;&#xD;&#xA;The browser asks the display to continue painting&#xD;&#xA;&#xD;&#xA;![596](https://wsnd.io/54nZDhov/596.jpg)&#xD;&#xA;&#xD;&#xA;The site first starts appearing&#xD;&#xA;&#xD;&#xA;![599](https://wsnd.io/8AhSg5wm/599.jpg)&#xD;&#xA;&#xD;&#xA;The text is dim, this may be the browser rendering a different color of text because the background is white&#xD;&#xA;&#xD;&#xA;![608](https://wsnd.io/COeZroSC/608.jpg)&#xD;&#xA;&#xD;&#xA;The site is finally rendered&#xD;&#xA;&#xD;&#xA;![614](https://wsnd.io/hbgaCOFr/614.jpg)&#xD;&#xA;&#xD;&#xA;## Interpretation of Results&#xD;&#xA;&#xD;&#xA;One hundred milliseconds is the goal, we might not reach the goal and that’s ok as well. In reaching for the goal we might be able to substantially improve the user experience. There are several things outside of our control such as internet speed and device speed. &#xD;&#xA;&#xD;&#xA;There are actually more things outside our control than inside. As we can see from the above analysis. Not only is internet speed variable but it depends how the interconnection from server to client is handled. Also there are a very wide range of devices that can access the web, many of which can introduce slowdown themselves.&#xD;&#xA;&#xD;&#xA;So let’s focus on the things we can control. How long it takes to process a request from receiving it, to sending it down the wire. Once we do send it down the wire we have the ability to measure how much data is sent.&#xD;&#xA;&#xD;&#xA;Let’s focus on processing speed on the server first. When we get a request we should take careful note of where the response actually comes in and how long it takes till we start doing something with it. I Read This Week uses an nginx reverse proxy and Go on the server and I was surprised at how quickly the response goes from server to nginx to Go to `gin`’s middleware and finally to my route definition. It didn’t take nearly as long as I thought. Originally I was reading the article off the database. But after adding a cache layer I could return the request as quickly as possible.&#xD;&#xA;&#xD;&#xA;The next thing we can optimize is what comes down the wire. This requires us to determine exactly what the webpage or webapp does. If it’s a blog or news site where the primary information that the person requesting will be textual, then it makes the most sense to encode it as HTML and send it down, it doesn’t get much faster.&#xD;&#xA;&#xD;&#xA;If it’s an app then the smallest thing that can possibly be displayed should come over first to show the user at least something is happening. The rest of the app will be ready in a few seconds and both the user and us expect the user to use the app for a few minutes.&#xD;&#xA;&#xD;&#xA;Sometimes the flow of a single page app can be “faked” using a website with multiple pages and if attention is paid to all of the above the speed can be just as performant across the board. As long as the user’s perception is kept in mind. So in essence the main point, which has been a long winded way of getting to the title of this post, is how it is possible to achieve “The Raw Speed of the Web.” &#xD;&#xA;&#xD;&#xA;## Conclusion&#xD;&#xA;&#xD;&#xA;The goal is to determine what exactly the app needs to do. In I Read This Weeks’s case it’s to take signups and show blog posts. That’s great because raw web was made to do stuff like this. One issue that comes up is state. Where will the state be stored because when a user signs up we have more than one question. In a single page app state can be stored in JavaScript and synced up to a server via a REST API that sends JSON back and forth. &#xD;&#xA;&#xD;&#xA;In our case however, the state is stored the same way, in a database, but each page transition only asks one question for each page. What we might miss out on is a slick animation that transitions from one question to the next but in the context of raw speed it’s actually quicker to the end user to do a full server hop because there’s no animation to slow us down.&#xD;&#xA;&#xD;&#xA;In the case of displaying a post the only thing that has to come down the wire is the actual post with HTML and text. &#xD;&#xA;&#xD;&#xA;The one thing I haven’t talked about so far is images. Yes, we should optimize images. The issue with images is the larger in millimeters the image is the longer it will take to load. The image should be large enough to display in size to get the point across and just enough resolution to look good. Reduce the size on disk to just enough, but no more. If needed a link can be provided on the image to a higher quality image and perhaps this should be a common practice. &#xD;&#xA;&#xD;&#xA;Will the web get faster? The web only needs to be as fast as the person looking at the page. We don’t need to get up to the theoretical speed limit of light if the person on the other end is a human with perception times that can only perceive a page up to a certain limit. Once we go faster we are in the range of video speed and then the same rules apply.&#xD;&#xA;&#xD;&#xA;If you enjoyed this post consider subscribing to the author, [Abe Massry](https://www.ireadthisweek.com/author/abemassry/previous)</description></item><item><title>I Read This Week - ireadthisweek - 2021-12-13</title><link>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/12/13</link><guid>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/12/13</guid><description># I built this blogging platform for HN readers&#xD;&#xA;&#xD;&#xA;![lr-image](https://wsnd.io/h1RLx61F/hn-img.jpg)&#xD;&#xA;&#xD;&#xA;**I Read This Week** was built for HN readers. Based on articles you’ve all been posting about blogging, the content of those articles, and the HN comments; this site was built for you.&#xD;&#xA;&#xD;&#xA;### Uses no JavaScript &#xD;&#xA;There is no javascript on this entire site except for one page by necessity.&#xD;&#xA;&#xD;&#xA;### Send email to create and append posts&#xD;&#xA;Have a thought? Want to compose your entire post in an email? Found a webpage that you’d like to share or talk about?&#xD;&#xA;Send yourself an email to a personalized @ireadthisweek.com email address and it will show up as your next post.&#xD;&#xA;If you send yourself an email more than one time in the week all of the emails get appended to, for one post with all of your content for the week.&#xD;&#xA;You actually don’t even have to interact with the site at all past the initial signup, you can continue sending yourself emails. &#xD;&#xA;&#xD;&#xA;### All posts in markdown&#xD;&#xA;Write markdown in email or in the `textarea` for this week’s upcoming post.&#xD;&#xA;&#xD;&#xA;### Auto publishes&#xD;&#xA;At the beginning of the week (on Monday morning) a new post is automatically published with the previous week’s content and any subscribers get the blog post in an email right to their inbox.&#xD;&#xA;&#xD;&#xA;### Custom domains&#xD;&#xA;Bring your custom domain, set your A and AAAA records and get a TLS cert provided by LetsEncrypt.&#xD;&#xA;&#xD;&#xA;### Send newsletter to subscribers, optional text only emails.&#xD;&#xA;Subscribers subscribe directly to you and get the same content on your blog to their inbox, they are subscribing to support you, and have the option of HTML emails or plain text emails.&#xD;&#xA;&#xD;&#xA;### Includes an RSS feed&#xD;&#xA;Every blog account gets an RSS feed&#xD;&#xA;&#xD;&#xA;### Analytics&#xD;&#xA;See how many people are reading your posts with custom built, yet very simple, non-javascript analytics on your profile page after you sign in. &#xD;&#xA;&#xD;&#xA;### Small but sustainable fee&#xD;&#xA;Subscribers pay $5 a month to subscribe to you.  You get $4.45. Stripe, our payment processor takes $0.45. We collect a small $0.10 fee (2%) each month from subscribers to maintain the service.  &#xD;&#xA;&#xD;&#xA;### Export your posts.&#xD;&#xA;Download a copy of all your data at anytime&#xD;&#xA;&#xD;&#xA;### Save your subscriber list&#xD;&#xA;If a subscriber agrees to share their email address with you, you get to keep it. You can then save it and reach out to them individually, or make your own newsletter, even though we wouldn&#39;t want to see you go, we want to give you the freedom of choosing to stay.&#xD;&#xA;&#xD;&#xA;### Small team open to feedback.&#xD;&#xA;Have an idea for a feature? Let us know and we’ll start working on it.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;This post was written by [Abe Massry](https://www.ireadthisweek.com/author/abemassry/previous) consider subscribing for more content like this.</description></item><item><title>I Read This Week - ireadthisweek - 2021-09-27</title><link>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/09/27</link><guid>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/09/27</guid><description># This site was built without JavaScript&#xD;&#xA;&#xD;&#xA;Actually the title isn’t 100% truthful, there is JavaScript on only one page, maybe you’ll find it 😁.&#xD;&#xA;&#xD;&#xA;![no-javascript](https://wsnd.io/IejzCCop/no-javascript.jpg)&#xD;&#xA;&#xD;&#xA;Building a site using no JavaScript at all is surprisingly difficult, some things you’d like to do are surprisingly difficult. Take form validation for example, sometimes you’d like to do front-end form validation as well as back-end form validation. It turns out there are now HTML5 form validation options built into browsers that browsers have natively implemented. So you can get some dynamic behavior without using JavaScript.&#xD;&#xA;&#xD;&#xA;## Form Validation&#xD;&#xA;&#xD;&#xA;Here’s what Google Chrome looks like when it renders:&#xD;&#xA;&#xD;&#xA;![html5-form-validation](https://wsnd.io/0xRNq6hY/html5-form-validation.png)&#xD;&#xA;&#xD;&#xA;Here’s what the code looks like:&#xD;&#xA;```&#xD;&#xA;&lt;input class=&#34;u-full-width&#34; type=&#34;email&#34; name=&#34;email&#34; value=&#34;username@example.com&#34; id=&#34;email&#34;&gt;&#xD;&#xA;```&#xD;&#xA;Specifically the `type=&#34;email&#34;` is what makes this appear as an email validation form. This is something implemented in the browser so there’s less chance of us [mere mortals](https://www.ex-parrot.com/pdw/Mail-RFC822-Address.html) getting email validation wrong.&#xD;&#xA;&#xD;&#xA;But what happens if we *do* want something arbitrary, less complex than email but some simple rules? It turns out that browsers have also implemented arbitrary form validation via regex matching.&#xD;&#xA;&#xD;&#xA;Here’s what it looks like:&#xD;&#xA;&#xD;&#xA;![html5-regex-form](https://wsnd.io/2AZw7Jc6/html5-regex-form.png)&#xD;&#xA;&#xD;&#xA;Here’s what the code looks like:&#xD;&#xA;```&#xD;&#xA;&lt;input class=&#34;u-full-width&#34; pattern=&#34;[a-zA-Z0-9_]{4,15}&#34; title=&#34;Letters, numbers, _ (underscore), less than 16 characters, more than 3&#34; type=&#34;text&#34; name=&#34;twitter&#34; value=&#34;abemassry&#34; id=&#34;twitter&#34;&gt;&#xD;&#xA;```&#xD;&#xA;This time the `pattern` is what gets checked and inside the double quotes you can put a regex string. The `title` tells you what the pattern is in English (or insert language of choice) and is displayed in the native tooltip.&#xD;&#xA;&#xD;&#xA;## Sign Up Flow&#xD;&#xA;&#xD;&#xA;The next part where JavaScript comes in handy is a sign up form, usually if there are many fields.&#xD;&#xA;&#xD;&#xA;In order to reduce the [cognitive overhead](https://en.wikipedia.org/wiki/Cognitive_load) of many fields in a signup form only one question was asked at a time. This actually turned out to be much simpler to step through because there was only one item on the screen in focus at a single time.&#xD;&#xA;&#xD;&#xA;The other benefit to this was each submission allows the user (prospective author) to essentially save their place in filling out the signup form and when they return they are at the exact spot they left off. There are only 4 questions though so it’s very easy to step through and sign up.&#xD;&#xA;&#xD;&#xA;Sometimes you might find a better way by making an arbitrary constraint and it seems to be beneficial in this case.&#xD;&#xA;&#xD;&#xA;## Retro&#xD;&#xA;&#xD;&#xA;In retrospect and retro style; JavaScript isn’t all bad, it’s used in tons of places, on the web, on the server, in microcontrollers. I really like JavaScript actually, but I wanted to see if it was possible to build a site without using it at all. In this context, a blogging and newsletter site, it is definitely beneficial because the primary response coming from the server is all text. However, some apps and websites would not be possible at all without JavaScript and I’ve written sites like this one, sites with minimal JavaScript, and sites that are JavaScript Single Page Apps (SPAs). So basically the entire range.&#xD;&#xA;&#xD;&#xA;The final takeaway from this post is use the right tool for the job.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;This post was written by [Abe Massry](https://www.ireadthisweek.com/author/abemassry/previous) consider subscribing for more content like this.&#xD;&#xA;</description></item><item><title>I Read This Week - ireadthisweek - 2021-08-15</title><link>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/08/15</link><guid>https://www.ireadthisweek.com/author/ireadthisweek/post/2021/08/15</guid><description># I Read This Week - Blog</description></item></channel></rss>