<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SolveDaily</title>
    <description>The latest articles on DEV Community by SolveDaily (@solvedaily).</description>
    <link>https://dev.to/solvedaily</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4172324%2F91f5b47f-3488-44f9-bf4c-6edf76ceb371.png</url>
      <title>DEV Community: SolveDaily</title>
      <link>https://dev.to/solvedaily</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/solvedaily"/>
    <language>en</language>
    <item>
      <title>How I got a 100/100 PageSpeed score on a site that updates every single day</title>
      <dc:creator>SolveDaily</dc:creator>
      <pubDate>Sat, 10 Oct 2026 23:22:05 +0000</pubDate>
      <link>https://dev.to/solvedaily/how-i-got-a-100100-pagespeed-score-on-a-site-that-updates-every-single-day-2b65</link>
      <guid>https://dev.to/solvedaily/how-i-got-a-100100-pagespeed-score-on-a-site-that-updates-every-single-day-2b65</guid>
      <description>&lt;p&gt;Daily-updating sites are the natural enemy of perfect performance scores. Every new image, every new page, every new script is another chance for layout shift, another uncached asset, another megabyte of JPEG. So when I set out to build a daily puzzle hints site, I gave myself a hard constraint: 100/100 on PageSpeed Insights, every single day — or the build fails.&lt;/p&gt;

&lt;p&gt;Here's how I did it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Static-first, generated with Python
&lt;/h2&gt;

&lt;p&gt;The site is fully static. A Python build script generates every page — no server-side rendering, no runtime database queries, no JavaScript framework. Each day's puzzle hint page is plain HTML produced at build time. That means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time to First Byte is just static file serving from a CDN.&lt;/li&gt;
&lt;li&gt;No client-side hydration, no framework runtime, no bundle to download and parse.&lt;/li&gt;
&lt;li&gt;The total JavaScript payload is essentially zero — just a few lines of vanilla JS for the interactive bits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python is the perfect tool for this: it fetches the puzzle data, renders templates, and writes out HTML files. The whole build takes seconds, and the output is as fast as the web gets.&lt;/p&gt;

&lt;h2&gt;
  
  
  WebP images with hash-busted URLs
&lt;/h2&gt;

&lt;p&gt;Images are the usual PageSpeed killer. My approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Convert everything to WebP at build time.&lt;/strong&gt; The build script converts source images to WebP with quality tuned for the content, typically cutting file sizes by 25–35% versus JPEG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hash-busted filenames.&lt;/strong&gt; Each image filename includes a content hash, e.g. &lt;code&gt;hint-image.a3f9c2.webp&lt;/code&gt;. When the image changes, the hash changes — so images are served with &lt;code&gt;Cache-Control: public, max-age=31536000, immutable&lt;/code&gt; (a full year of caching) with zero risk of stale content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explicit &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; attributes&lt;/strong&gt; on every &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag to eliminate cumulative layout shift.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result: images that are small, never re-downloaded unnecessarily, and never shift the layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aggressive caching, layered properly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Images and hashed assets:&lt;/strong&gt; &lt;code&gt;immutable&lt;/code&gt;, cached for a year.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML pages:&lt;/strong&gt; short TTL with CDN revalidation — each daily page changes once a day, so a short cache plus &lt;code&gt;stale-while-revalidate&lt;/code&gt; keeps it fast &lt;em&gt;and&lt;/em&gt; fresh.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preconnect&lt;/strong&gt; hints for any third-party origins.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because assets are content-hashed, the CDN can cache them essentially forever. Repeat visitors download almost nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  A content-aware build check that fails on spoiler leaks
&lt;/h2&gt;

&lt;p&gt;This is the part I'm most proud of. A daily hints site has a unique correctness problem: accidentally publishing a future day's answers — a spoiler leak — would ruin the whole point of the site. So the build includes a content-aware verification step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The build script knows exactly which puzzle data belongs to which date.&lt;/li&gt;
&lt;li&gt;After generating the pages, a check scans the output HTML for answer strings that must not appear on a given date's page.&lt;/li&gt;
&lt;li&gt;If a leak is detected, the build &lt;strong&gt;fails&lt;/strong&gt; — nothing gets deployed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's like a test suite for content correctness, running on every single build. Performance means nothing if the content is wrong, and this check makes wrong content undeployable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;100/100 on PageSpeed Insights — Performance, Accessibility, Best Practices, SEO — on a site that rebuilds and redeploys every single day. The recipe:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Static HTML generated by Python — no runtime cost.&lt;/li&gt;
&lt;li&gt;WebP images with content-hash filenames and immutable caching.&lt;/li&gt;
&lt;li&gt;Aggressive, layered cache headers.&lt;/li&gt;
&lt;li&gt;A build-time content check that fails the deploy on spoiler leaks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Constraints breed creativity. Making the build fail on anything less than perfect — in both performance &lt;em&gt;and&lt;/em&gt; content correctness — is what keeps the score at 100.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading! I'm building &lt;a href="https://gosolvedaily.com" rel="noopener noreferrer"&gt;GoSolveDaily&lt;/a&gt; — daily puzzle hints, engineered for speed.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>webdev</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
