<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Faizalhussain on Medium]]></title>
        <description><![CDATA[Stories by Faizalhussain on Medium]]></description>
        <link>https://medium.com/@faizalhussain314?source=rss-af2be12b76dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TKRu0a2i36auozcx</url>
            <title>Stories by Faizalhussain on Medium</title>
            <link>https://medium.com/@faizalhussain314?source=rss-af2be12b76dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 12:04:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@faizalhussain314/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Fixed the CSS, So Why Is My Website Still Showing the Old Styles?]]></title>
            <link>https://medium.com/@faizalhussain314/i-fixed-the-css-so-why-is-my-website-still-showing-the-old-styles-3763f5e9b2cb?source=rss-af2be12b76dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3763f5e9b2cb</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Faizalhussain]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 07:47:34 GMT</pubDate>
            <atom:updated>2026-10-17T07:47:34.485Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve fixed the CSS issue.</p><p>The button now has the correct color. The spacing looks right. The layout finally behaves the way you wanted locally.</p><p>You commit the changes, deploy the application, and open the website to check your work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13hY7TNyg7h4KnfOXk-icg.png" /></figure><p><strong>The old CSS is still there.</strong></p><p>You refresh the page.</p><p>Nothing changes.</p><p>You refresh it again.</p><p>Still the same.</p><p>At this point, you might start checking your CSS selector, wondering whether another rule is overriding your styles, or questioning whether your deployment actually worked.</p><p>But before changing your CSS for the fifth time, consider something else:</p><p><strong>What if the browser isn’t using the CSS file you just deployed?</strong></p><p>This is one of those frontend problems where the code can be correct, the deployment can be successful, and the browser can still show an older version of the application.</p><p>The reason often comes down to caching.</p><p>And understanding how to handle it properly is more useful than simply telling everyone to do a hard refresh.</p><h3>First, Let’s Understand What the Browser Is Doing</h3><p>Imagine your application loads a stylesheet from this URL:</p><p><a href="https://example.com/assets/styles.css">https://example.com/assets/styles.css</a></p><p>The browser downloads the file and applies its styles to the page.</p><p>But downloading the same file every time a user visits the website would be wasteful. If the stylesheet hasn’t changed, why download it again?</p><p>To avoid unnecessary network requests, browsers can store resources such as CSS, JavaScript, images, and fonts in their HTTP cache.</p><p>The next time the browser needs that stylesheet, it may reuse the cached copy instead of downloading it again.</p><p>That’s a good thing.</p><p>It makes websites faster, reduces network traffic, and improves the experience for returning visitors.</p><p><strong>The problem begins when the browser has an old copy but your application has already moved on to a new version.</strong></p><p>For example:</p><ul><li>The browser has cached styles.css from yesterday.</li><li>You fix a layout issue and deploy the updated stylesheet today.</li><li>The stylesheet’s URL remains exactly the same.</li><li>The browser may continue using the previous version, depending on its caching rules.</li></ul><p>Your new CSS exists on the server, but the browser might not request it yet.</p><p>This is why refreshing the page doesn’t always solve the problem.</p><h3>Why Doesn’t a Normal Refresh Fix It?</h3><p>Because a browser refresh doesn’t necessarily mean “download every resource from the server again.”</p><p>HTTP caching follows specific rules.</p><p>The browser considers factors such as cache directives, resource freshness, and whether the server needs to validate a stored response.</p><p>For example, consider this response header:</p><pre>Cache-Control: public, max-age=86400</pre><p>It tells the browser and eligible shared caches that the response can be considered fresh for 86,400 seconds — 24 hours.</p><p>During that period, the browser may reuse the cached stylesheet without contacting the server to check whether a newer version exists.</p><p>That’s perfectly reasonable when the file hasn’t changed.</p><p>But if you update the contents while keeping the same URL, the cached response can become a problem.</p><p>There are ways to force revalidation, and developers can use a hard refresh while debugging. However, neither is a good substitute for a proper production caching strategy.</p><p>So how do we solve this without asking every user to clear their cache?</p><p><strong>We change how the browser identifies the file.</strong></p><h3>This Is Where Cache Busting Comes In</h3><p>Let’s start with a simple example.</p><p>Your application currently loads:</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;/assets/styles.css&quot;&gt;</pre><p>You update the CSS and deploy the new version.</p><p>The URL hasn’t changed.</p><p>From the browser’s perspective, it’s still requesting the same resource. Depending on the caching configuration, it may be able to reuse an existing response.</p><p>Now imagine the build generates a different filename whenever the stylesheet’s contents change:</p><pre>&lt;!-- Previous deployment --&gt;<br>&lt;link rel=&quot;stylesheet&quot; href=&quot;/assets/styles.a81f3c.css&quot;&gt;</pre><pre>&lt;!-- New deployment --&gt;<br>&lt;link rel=&quot;stylesheet&quot; href=&quot;/assets/styles.f42d91.css&quot;&gt;</pre><p>Notice the difference?</p><p>The CSS has a new URL.</p><p>When the browser encounters /assets/styles.f42d91.css, it treats it as a different resource from /assets/styles.a81f3c.css. If the new resource isn&#39;t already cached, the browser needs to fetch it.</p><p>This technique is called <strong>cache busting</strong>.</p><p>Instead of trying to force the browser to forget an old file, we give the updated file a new URL.</p><p>It’s a simple idea, but it solves an important problem: how can we cache assets aggressively without preventing users from receiving new versions?</p><h3>But Why Do the Filenames Change?</h3><p>Modern build tools can use a hash derived from a file’s contents to generate asset filenames.</p><p>For example, a build might transform:</p><pre>src/styles.css</pre><p>into:</p><pre>assets/styles.a81f3c.css</pre><p>After you change the CSS, the next build might generate:</p><pre>assets/styles.f42d91.css</pre><p>The exact naming scheme depends on the build tool and its configuration.</p><p>Tools such as Vite and Webpack support generating hashed asset filenames as part of their production builds.</p><p>The important detail is that <strong>the filename changes when the relevant file contents change</strong>.</p><p>If the file remains unchanged, its content hash can remain unchanged too. This allows the browser to reuse the cached asset across deployments when appropriate.</p><p>Compare this with adding a random query parameter to every request:</p><pre>styles.css?v=123<br>styles.css?v=456</pre><p>That can also create different cache keys, but manually maintaining version numbers is easy to get wrong. A content-derived hash connects the URL directly to the built file’s contents.</p><p>It also makes the deployment process more reliable because the build system can generate the filenames automatically.</p><h3>The Interesting Part: Cache Busting Makes Caching Better</h3><p>You might think the safest solution is to prevent the browser from caching CSS altogether.</p><p>Something like this:</p><pre>Cache-Control: no-store</pre><p>But that would be a poor default for many production assets.</p><p>Your CSS file might be identical for weeks. Downloading it repeatedly wastes bandwidth and can slow down page loads.</p><p>A more effective strategy is to separate your assets into two categories.</p><h3>1. Content-hashed assets</h3><p>Examples:</p><pre>styles.a81f3c.css<br>app.72be91.js<br>logo.5d2a10.svg</pre><p>Because the URL changes when the file’s contents change, these assets can often be cached for a long time.</p><p>For example:</p><pre>Cache-Control: public, max-age=31536000, immutable</pre><p>This allows caching for up to one year and indicates that the resource at that URL won’t be replaced with different contents.</p><p>The immutable directive is appropriate when your build and deployment process genuinely guarantees that a URL always identifies the same asset contents.</p><h3>2. HTML documents</h3><p>Your HTML is different.</p><p>It may contain references to the latest CSS and JavaScript filenames:</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;/assets/styles.f42d91.css&quot;&gt;<br>&lt;script src=&quot;/assets/app.72be91.js&quot;&gt;&lt;/script&gt;</pre><p>If the browser keeps serving old HTML, it might never discover the new CSS filename.</p><p>That’s the catch.</p><p>You could generate perfect content hashes for every asset and still have a stale page if the HTML that references those assets isn’t updated or revalidated correctly.</p><p>HTML therefore needs a caching strategy appropriate to how frequently it changes. One common approach is to require revalidation:</p><pre>Cache-Control: no-cache</pre><p>Despite its name, no-cache does not mean &quot;never store this response.&quot; It allows storage but requires revalidation before a cached response is reused.</p><p>This is different from no-store, which tells caches not to store the response.</p><p>A practical production strategy often looks like this:</p><p>ResourceTypical strategyHashed CSS and JavaScriptLong-lived caching with immutableHashed images and fontsLong-lived caching with immutableHTML documentsRevalidation or a short freshness lifetimeFrequently changing API responsesPolicy based on the data and freshness requirements</p><p>These are common patterns, not universal rules. The right policy depends on the application, infrastructure, and data sensitivity.</p><h3>So Why Can the Old CSS Still Appear After Cache Busting?</h3><p>Here’s where things get interesting.</p><p>Cache busting solves the problem of reusing an old asset URL after the application references a new one. It doesn’t automatically solve every caching problem in a production environment.</p><p>There are a few other places to investigate.</p><h3>1. The HTML Is Still Old</h3><p>Suppose the browser receives an older HTML document that references:</p><pre>/assets/styles.a81f3c.css</pre><p>Even though the deployment generated styles.f42d91.css, the browser doesn&#39;t know about it until it receives HTML that references the new filename.</p><p>The solution isn’t necessarily to change the CSS again. You need to investigate how the HTML is being cached and served.</p><h3>2. A CDN Is Serving a Stale Response</h3><p>Your website might use a content delivery network (CDN) between the browser and your origin server.</p><p>Depending on the CDN configuration, it may have cached an older response.</p><p>If the browser requests a new hashed filename that doesn’t exist at the CDN or origin, investigate the asset deployment and propagation. If the URL is unchanged, check the relevant cache key, freshness rules, and invalidation behaviour.</p><p>Cache busting works best when the new asset is available before the HTML referencing it becomes available.</p><h3>3. A Service Worker Is Intercepting Requests</h3><p>If your application uses a service worker, it may have its own caching logic through the Cache API.</p><p>For example, a service worker configured to serve cached assets first might return an older stylesheet even when you expect a network request.</p><p>In that case, changing HTTP cache headers alone might not solve the issue. You need to inspect the service worker’s fetch handler, cache strategy, and update lifecycle.</p><h3>4. The Deployment Removed an Asset Too Early</h3><p>Imagine a user opens your application before a deployment and keeps the tab open.</p><p>That page still references:</p><pre>/assets/styles.a81f3c.css</pre><p>You deploy a new version and immediately delete the previous build’s assets.</p><p>Now the user’s open tab may request a file that no longer exists.</p><p>The result can be a failed request, broken styles, or another asset-loading issue.</p><p>A safer deployment strategy retains previous hashed assets for an appropriate period, allowing older HTML documents and open tabs to continue working while users transition to the new version.</p><p><strong>A successful deployment isn’t just about uploading the new files. It’s also about making sure the files referenced by existing pages remain available when needed.</strong></p><h3>How I Would Debug This in a Real Project</h3><p>Before changing the CSS again, I’d open Chrome DevTools and investigate the actual resource.</p><p>Here’s a practical sequence.</p><p><strong>Step 1: Inspect the stylesheet request.</strong></p><p>Open DevTools, go to the Network tab, filter by CSS, and reload the page.</p><p>Find the stylesheet responsible for the affected component.</p><p>Check its requested URL, status code, response headers, and whether DevTools indicates that the response came from memory cache, disk cache, or a service worker.</p><p><strong>Step 2: Check the actual response.</strong></p><p>Open the stylesheet’s Response tab.</p><p>Is the updated CSS present in the response?</p><p>If not, the browser may be receiving an old asset, or your deployment may not have updated the resource you’re requesting.</p><p>If the new CSS is present, inspect the Elements panel and Computed Styles to see whether another selector, stylesheet, or cascade rule is overriding it.</p><p><strong>Step 3: Compare the asset URL with the current build.</strong></p><p>Check the HTML or DOM to see which stylesheet filename is being referenced.</p><p>Compare it with the assets produced by your latest build.</p><p>If the page references an old hashed filename, investigate stale HTML, deployment ordering, or caching upstream.</p><p><strong>Step 4: Temporarily disable the browser cache.</strong></p><p>With DevTools open, enable <em>Disable cache</em> in the Network tab and reload the page.</p><p>This is useful for debugging because it helps determine whether the browser’s HTTP cache is involved.</p><p>However, it doesn’t automatically bypass every CDN or service-worker caching strategy, and it doesn’t reproduce every user’s normal browsing conditions.</p><p><strong>Step 5: Check the infrastructure if necessary.</strong></p><p>If the browser requests the correct URL but receives an unexpected response, investigate the CDN, origin server, service worker, and deployment configuration.</p><p>The goal is to find the layer serving the old resource instead of repeatedly editing CSS that may already be correct.</p><h3>The Bigger Lesson</h3><p>Cache busting looks like a small build-tool feature, but it reflects a much bigger engineering principle.</p><p><strong>Caching works best when resources can be reused safely and updated predictably.</strong></p><p>Content-hashed filenames give browsers a reliable way to distinguish different versions of an asset. Appropriate HTTP caching policies allow unchanged files to be reused efficiently. Correct HTML caching and deployment practices ensure that users discover new asset URLs without breaking pages that still reference old ones.</p><p>These pieces need to work together.</p><p>So the next time you fix a CSS issue and the browser continues showing the old styles, don’t immediately assume your CSS is wrong.</p><p>Ask a better question:</p><p><strong>Is the browser actually receiving the version of the stylesheet I intended to deploy?</strong></p><p>That question takes you from randomly refreshing a page to systematically debugging a production issue.</p><p>And that is an important step in moving from writing frontend code to understanding how frontend applications behave in production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3763f5e9b2cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Browser Fingerprinting Explained for Frontend Developers]]></title>
            <link>https://medium.com/@faizalhussain314/browser-fingerprinting-explained-for-frontend-developers-7ae8fe83584f?source=rss-af2be12b76dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ae8fe83584f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[advanced-javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Faizalhussain]]></dc:creator>
            <pubDate>Thu, 30 Jul 2026 12:07:10 GMT</pubDate>
            <atom:updated>2026-07-30T12:07:10.728Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How websites identify your browser even without cookies.</em></p><h3><em>How websites identify your browser even without cookies.</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_CrUpyu3sXjD5bZdyYJJg.png" /></figure><h3>Introduction</h3><p>Imagine this.</p><p>You visit an e-commerce website for the first time.</p><p>You don’t log in.</p><p>You reject all cookies.</p><p>You even open the website in Incognito mode.</p><p>But somehow, the website still knows that it has seen your browser before.</p><p>How is that possible?</p><p>The answer is <strong>Browser Fingerprinting</strong>.</p><p>When I first learned about this, I thought websites were only using cookies or local storage to identify users. But I was surprised to find that browsers already expose a lot of information through different Web APIs. When all of these values are combined, they can create a unique fingerprint for your browser.</p><p>In this article, I’ll explain how browser fingerprinting works and why libraries like FingerprintJS are able to identify browsers even when cookies are disabled.</p><h3>What is Browser Fingerprinting?</h3><p>Browser fingerprinting is a technique used to identify a browser by collecting different pieces of information that the browser already exposes.</p><p>A single value is usually not unique.</p><p>For example:</p><ul><li>Thousands of users may have the same screen resolution.</li><li>Thousands of users may use Chrome.</li><li>Thousands of users may have the same language.</li></ul><p>But when many of these values are combined together, the final combination becomes much more unique.</p><p>Think of it like this.</p><p>Imagine you’re trying to identify someone in a crowd.</p><p>Just knowing they wear a blue shirt isn’t enough.</p><p>But if you know:</p><ul><li>Blue shirt</li><li>Black shoes</li><li>Glasses</li><li>Height</li><li>Curly hair</li></ul><p>Now it’s much easier to identify that person.</p><p>Browser fingerprinting works in a similar way.</p><h3>What Information Does the Browser Expose?</h3><p>Modern browsers provide a lot of information through JavaScript APIs.</p><p>Some common examples are:</p><ul><li>Browser name</li><li>Browser version</li><li>Operating system</li><li>Screen resolution</li><li>Device pixel ratio</li><li>Language</li><li>Timezone</li><li>Platform</li><li>Number of CPU cores</li><li>Device memory</li><li>Touch support</li><li>Color depth</li></ul><p>These values are easy to access using JavaScript.</p><p>For example:</p><pre>console.log(navigator.language);<br>console.log(screen.width);<br>console.log(screen.height);<br>console.log(Intl.DateTimeFormat().resolvedOptions().timeZone);</pre><p>Individually, these values are not unique.</p><p>But together, they become much more useful.</p><h3>It Doesn’t Stop There</h3><p>Browser fingerprinting also uses more advanced techniques.</p><p>Some of them include:</p><ul><li>Canvas Fingerprinting</li><li>WebGL Fingerprinting</li><li>Audio Fingerprinting</li><li>Installed Fonts</li><li>Hardware Information</li></ul><p>These values are much harder to fake and add more uniqueness to the fingerprint.</p><p>Let’s understand them one by one.</p><h3>Canvas Fingerprinting</h3><p>The HTML Canvas API allows websites to draw graphics.</p><p>A fingerprinting library draws hidden text or shapes on the canvas.</p><p>Then it reads the generated image.</p><p>Although every browser receives the same drawing instructions, the final image may be slightly different because of:</p><ul><li>Operating system</li><li>Graphics driver</li><li>GPU</li><li>Browser rendering engine</li><li>Font rendering</li></ul><p>These tiny differences can be used as part of the browser fingerprint.</p><h3>WebGL Fingerprinting</h3><p>WebGL is used for rendering 2D and 3D graphics.</p><p>It also exposes information about the graphics hardware.</p><p>For example:</p><ul><li>GPU Vendor</li><li>GPU Renderer</li></ul><p>Different devices usually return different values.</p><p>This adds another piece to the fingerprint.</p><h3>Audio Fingerprinting</h3><p>This one surprised me the most.</p><p>Browsers have a Web Audio API.</p><p>A website can generate a small audio signal in the background.</p><p>Instead of playing it, the website analyzes the generated output.</p><p>Small differences in hardware and browser implementations can produce slightly different results.</p><p>These differences become another fingerprint signal.</p><h3>Fonts</h3><p>Different users install different fonts.</p><p>A website can detect which fonts are available on your device.</p><p>The combination of installed fonts can make your browser more unique.</p><h3>How Does Browser Fingerprinting Work?</h3><p>The overall process is actually simple.</p><pre>Browser</pre><pre>↓</pre><pre>Collect Browser Information</pre><pre>↓</pre><pre>Canvas<br>WebGL<br>Fonts<br>Timezone<br>Screen Size<br>Language<br>CPU<br>Memory</pre><pre>↓</pre><pre>Combine All Values</pre><pre>↓</pre><pre>Generate Browser Fingerprint</pre><pre>↓</pre><pre>Visitor ID</pre><p>The Visitor ID is generated based on the collected values.</p><p>If most of those values remain the same, the same browser usually gets the same Visitor ID.</p><h3>Where is Browser Fingerprinting Used?</h3><p>Many companies use browser fingerprinting for security instead of tracking users.</p><p>Some common use cases are:</p><h3>Fraud Detection</h3><p>Banks and payment gateways use it to detect suspicious devices.</p><h3>Preventing Multiple Accounts</h3><p>Some websites don’t allow users to create unlimited accounts.</p><p>Browser fingerprinting helps detect repeated sign-ups from the same browser.</p><h3>Bot Detection</h3><p>Automated browsers often expose different characteristics than real browsers.</p><p>Fingerprinting helps identify them.</p><h3>Account Protection</h3><p>Imagine you always log in from the same laptop.</p><p>Suddenly, someone tries to log in using a completely different browser fingerprint.</p><p>That login can be marked as suspicious and may require additional verification.</p><h3>Can Browser Fingerprinting Identify You 100%?</h3><p>No.</p><p>Browser fingerprinting is not perfect.</p><p>Your fingerprint can change when:</p><ul><li>You update your browser.</li><li>You change your operating system.</li><li>You install new fonts.</li><li>You change your graphics driver.</li><li>You switch devices.</li></ul><p>Privacy-focused browsers may also reduce the amount of information that websites can collect.</p><p>Because of this, browser fingerprinting should be treated as a probability-based technique rather than a guaranteed way to identify someone.</p><h3>What About Cookies?</h3><p>Cookies and browser fingerprinting are different.</p><p>Cookies store data inside the browser.</p><p>Browser fingerprinting doesn’t need to store anything.</p><p>Instead, it creates an identity based on the information that the browser already exposes.</p><p>That’s why deleting cookies doesn’t always prevent a website from recognizing your browser.</p><h3>Where Does FingerprintJS Fit In?</h3><p>FingerprintJS is a library that automates this entire process.</p><p>Instead of manually collecting dozens of browser signals, it gathers them, processes them, and generates a Visitor ID.</p><p>As developers, we don’t have to implement all the detection logic ourselves.</p><p>The library handles most of the work.</p><h3>Final Thoughts</h3><p>Before learning about browser fingerprinting, I assumed cookies were the only way websites could recognize users.</p><p>But modern browsers expose a lot of information through standard APIs.</p><p>When those values are combined, they can create a surprisingly unique browser fingerprint.</p><p>Browser fingerprinting is widely used for fraud detection, account security, and bot protection. At the same time, it also raises important privacy questions, which is why developers should understand both its benefits and its limitations.</p><p>As frontend developers, we don’t just build user interfaces. Understanding how browsers work behind the scenes helps us build better and more secure applications.</p><p>Thanks for reading! If you found this useful, feel free to share it with other frontend developers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ae8fe83584f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>