<?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>Forem: Ella</title>
    <description>The latest articles on Forem by Ella (@ellapark).</description>
    <link>https://forem.com/ellapark</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2912329%2F48989fed-5666-4dd6-9c41-d74baae7f80c.png</url>
      <title>Forem: Ella</title>
      <link>https://forem.com/ellapark</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ellapark"/>
    <language>en</language>
    <item>
      <title>Why ZTNA is replace of VPN?</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Wed, 21 Jan 2026 09:43:18 +0000</pubDate>
      <link>https://forem.com/ellapark/why-ztna-is-replace-of-vpn-46jb</link>
      <guid>https://forem.com/ellapark/why-ztna-is-replace-of-vpn-46jb</guid>
      <description>&lt;p&gt;Many people tend to say that ZTNA (Zero Trust Network Access) is a substitute for VPNs.&lt;br&gt;
What do they have in common, and what are the key differences?&lt;br&gt;
More importantly, why do people make this comparison?&lt;/p&gt;

&lt;p&gt;Let’s take a closer look at how ZTNA differs from traditional VPNs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg01r21u56g4hrv5qh2ct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg01r21u56g4hrv5qh2ct.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Authentication process
&lt;/h2&gt;

&lt;p&gt;The first difference lies in the authentication process.&lt;br&gt;
In a Zero trust model, authentication is significantly strengthened.&lt;/p&gt;

&lt;p&gt;With traditional VPNs, authentication is typically based on ID/password or OTP.&lt;br&gt;
With ZTNA, access is denied if the device has not been pre-approved.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Scope of access
&lt;/h2&gt;

&lt;p&gt;There is a difference in the scope of access after authentication.&lt;br&gt;
As the name suggests, VPN stands for "Virtual Private Network" and is a network-based solution.&lt;/p&gt;

&lt;p&gt;Once connected to a VPN, users can access all network resources within the internal network.&lt;br&gt;
However, ZTNA focuses on "network access" at the application level, following the Zero Trust principle of trusting &lt;strong&gt;no one by default.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Continuous Authentication in ZTNA
&lt;/h2&gt;

&lt;p&gt;When discussing ZTNA, the concept of continuous authentication is often misunderstood.&lt;br&gt;
Some assume it means users are required to repeatedly enter their ID, password, or OTP every time they attempt to access additional resources, which would clearly degrade the user experience.&lt;/p&gt;

&lt;p&gt;However, continuous authentication in ZTNA has a very different meaning.&lt;/p&gt;

&lt;p&gt;Even after a user successfully completes the initial authentication by meeting all required conditions, ZTNA continuously evaluates the security posture of the device throughout the session. If any of the predefined conditions change, access can be revoked, or re-authentication can be enforced—even for an already authenticated session.&lt;/p&gt;

&lt;p&gt;For example, a user may initially pass authentication because their device meets all security requirements, such as having an active antivirus program. If that antivirus is later disabled or removed during the session, ZTNA can detect the change, immediately terminate the session, and require re-authentication before allowing further access.&lt;/p&gt;

&lt;p&gt;This continuous verification model ensures that trust is never permanent and is always reassessed based on real-time security conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So far, we have explored the key differences between traditional VPNs and ZTNA.&lt;br&gt;
Through this comparison, it becomes clear why ZTNA is often considered more secure than VPNs and is frequently described as a replacement rather than just an alternative.&lt;/p&gt;

&lt;p&gt;By enforcing strict authentication, limiting access at the application level, and continuously verifying security conditions, ZTNA fundamentally changes how access to internal resources is protected.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>networking</category>
      <category>security</category>
    </item>
    <item>
      <title>Understanding Akamai GTM: Mirror Failover vs. Weighted Random Load Balancing</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Tue, 28 Oct 2025 05:29:20 +0000</pubDate>
      <link>https://forem.com/ellapark/understanding-akamai-gtm-mirror-failover-vs-weighted-random-load-balancing-52da</link>
      <guid>https://forem.com/ellapark/understanding-akamai-gtm-mirror-failover-vs-weighted-random-load-balancing-52da</guid>
      <description>&lt;p&gt;Recently, I reviewed how &lt;a href="https://techdocs.akamai.com/gtm/docs/gtm-concepts" rel="noopener noreferrer"&gt;Akamai Global Traffic Management (GTM)&lt;/a&gt; handles load distribution and failover between multiple data centers. Two property types that often cause confusion are &lt;strong&gt;Mirror Failover&lt;/strong&gt; and &lt;strong&gt;Weighted Random Load Balancing.&lt;/strong&gt; At first glance, they seem similar because both can return two IPs and appear to distribute traffic evenly. However, their internal logic works very differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mirror Failover: Prioritizing High Availability
&lt;/h2&gt;

&lt;p&gt;In a Mirror Failover configuration, GTM continuously monitors the health of the primary data center. When the primary is healthy, all traffic is directed there. If the primary goes down, GTM immediately redirects users to the backup data center.&lt;/p&gt;

&lt;p&gt;When combined with the All-live-IPs setting, both IPs can be returned under normal conditions. But once a health check fails, the failing IP is automatically removed from the DNS response.&lt;/p&gt;

&lt;p&gt;This approach focuses on &lt;strong&gt;high availability and immediate recovery&lt;/strong&gt;, making it ideal for services where &lt;strong&gt;failover speed and stability&lt;/strong&gt; are more important than precise load balancing accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Weighted Random Load Balancing: Prioritizing Distribution Accuracy
&lt;/h2&gt;

&lt;p&gt;Weighted Random Load Balancing focuses on distributing traffic as evenly as possible based on predefined weights. GTM assigns each DNS query to a data center randomly, but the probability is determined by the configured ratio.&lt;/p&gt;

&lt;p&gt;For example, if two data centers have a 50:50 ratio, roughly half of the traffic will go to each. This happens regardless of where the users are located.&lt;/p&gt;

&lt;p&gt;When a data center fails, GTM removes it from the rotation after detecting the failure through its health check. However, this change does not occur instantly, so some users may still receive the unhealthy IP for a short time until GTM updates its status.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are They the Same?
&lt;/h2&gt;

&lt;p&gt;Not exactly. Both configurations can look similar in normal operation since they may return two IPs and distribute traffic relatively evenly. The key difference lies in their behavior during failover.&lt;/p&gt;

&lt;p&gt;Mirror Failover prioritizes instant redirection to a healthy data center, while Weighted Random prioritizes consistent load balancing. Mirror Failover reacts immediately to failures, while Weighted Random relies on probabilistic assignment and may take slightly longer to fully switch away from an unhealthy node.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing Between Them
&lt;/h2&gt;

&lt;p&gt;If your goal is &lt;em&gt;disaster recovery (DR) testing,&lt;/em&gt; where one data center is intentionally taken offline and you want traffic to reroute automatically, Mirror Failover with All-live-IPs is more reliable. It ensures that failover happens immediately when a failure is detected.&lt;/p&gt;

&lt;p&gt;If your focus is on &lt;em&gt;continuous and balanced load distribution across multiple live data centers&lt;/em&gt;, and immediate failover is not critical, Weighted Random Load Balancing can be a suitable option.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;Both configurations distribute traffic fairly evenly under normal conditions, but they serve different purposes. Mirror Failover is designed for high availability and immediate failover, while Weighted Random is designed for precise load balancing and traffic optimization.&lt;/p&gt;

&lt;p&gt;Understanding these subtle differences helps ensure that your GTM configuration aligns with your operational goals, whether that means prioritizing stability or optimizing distribution.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>networking</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>What Really Defines a Botnet?</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Tue, 09 Sep 2025 10:49:53 +0000</pubDate>
      <link>https://forem.com/ellapark/what-really-defines-a-botnet-3eji</link>
      <guid>https://forem.com/ellapark/what-really-defines-a-botnet-3eji</guid>
      <description>&lt;p&gt;Many people assume that a botnet is defined by IP address or location. In reality, a single botnet ID can include devices with &lt;strong&gt;multiple IPs, various operating systems, and different hardware.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once, my client's website was attacked by a botnet. I blocked it, but the same botnet kept attacking other domains with different IPs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2tywuv9kztg25bu2b74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2tywuv9kztg25bu2b74.png" alt=" " width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why? Because a botnet is essentially a &lt;em&gt;distributed network&lt;/em&gt; of compromised devices.&lt;br&gt;
A laptop in Korea, a printer in the U.S., a smartphone in Germany… all of these can be part of the same botnet if they’re controlled by the same attacker.&lt;/p&gt;




&lt;h1&gt;
  
  
  1️⃣ How do we categorize devices into a single botnet?
&lt;/h1&gt;

&lt;p&gt;The key question is: &lt;strong&gt;“Who is controlling them?”&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;C&amp;amp;C Server (Command &amp;amp; Control):&lt;/strong&gt; the central “brain” of the botnet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Common malicious code:&lt;/strong&gt; the program installed on infected devices that connects them to the C&amp;amp;C server&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if devices differ in IP, location, or type, if they run the &lt;strong&gt;same malicious code&lt;/strong&gt; and communicate with the &lt;strong&gt;same C&amp;amp;C server&lt;/strong&gt;, they belong to the same botnet.&lt;/p&gt;

&lt;p&gt;👉 Think of it like a remote-controlled army:&lt;br&gt;
Each soldier may look different, but they all follow the same commander’s orders.&lt;/p&gt;




&lt;h1&gt;
  
  
  2️⃣ How does a botnet launch attacks?
&lt;/h1&gt;

&lt;p&gt;Once connected to the C&amp;amp;C server, attackers can issue commands to all bots simultaneously:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DDoS attacks:&lt;/strong&gt; flooding websites with massive traffic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spam campaigns:&lt;/strong&gt; sending thousands of emails at once&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Malware distribution:&lt;/strong&gt; spreading ransomware or other malicious software&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the attacks come from thousands of devices around the world, tracking the attacker is extremely difficult. This global distribution also amplifies the attack’s impact.&lt;/p&gt;




&lt;h1&gt;
  
  
  3️⃣ Where does the C&amp;amp;C server live, and who sets it up?
&lt;/h1&gt;

&lt;p&gt;The C&amp;amp;C server is the botnet’s control center. Attackers often set it up in ways that make tracking hard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cloud servers or VPS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compromised servers belonging to companies or individuals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Peer-to-peer (P2P) networks where bots relay commands to each other&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short, it doesn’t matter where the server is physically located—what matters is that bots can connect to it to receive commands.&lt;/p&gt;




&lt;h1&gt;
  
  
  4️⃣ Why botnets are hard to stop
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Detection is tricky:&lt;/strong&gt; Security analysts rely on malware patterns and unusual traffic behavior to identify botnets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Defense is multi-layered:&lt;/strong&gt; Updating software, using antivirus tools, and monitoring network traffic are essential.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;**Botnets keep evolving: **Modern botnets use encrypted communication, P2P structures, and target not only PCs but also IoT devices like cameras, printers, and smart appliances.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Think of botnets like a living organism: they adapt, hide, and grow stronger over time.&lt;/p&gt;




&lt;h1&gt;
  
  
  5️⃣ Key Takeaways
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Botnet ID = C&amp;amp;C server + common malicious code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Location, IP, and device type do not define a botnet&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Attacks are coordinated via the C&amp;amp;C server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Detection requires malware analysis and traffic monitoring&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Botnets are constantly evolving&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Understanding how botnets work is critical—not just for security professionals, but for &lt;strong&gt;anyone connected to the internet.&lt;/strong&gt;&lt;br&gt;
Even a single unpatched device could become part of a global attack network.&lt;/p&gt;

</description>
      <category>security</category>
    </item>
    <item>
      <title>Tracking, Security, and Control: What the Referer Header Tells You</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Thu, 31 Jul 2025 06:15:41 +0000</pubDate>
      <link>https://forem.com/ellapark/tracking-security-and-control-what-the-referer-header-tells-you-3ghj</link>
      <guid>https://forem.com/ellapark/tracking-security-and-control-what-the-referer-header-tells-you-3ghj</guid>
      <description>&lt;p&gt;When managing a website, there's one question we constantly ask ourselves:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;"Where are these visitors coming from?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Did they find us through Google?&lt;br&gt;&lt;br&gt;
Click an ad on Instagram?&lt;br&gt;&lt;br&gt;
Or did a partner site refer them?&lt;/p&gt;

&lt;p&gt;The answer often lies in a small but powerful piece of information: the &lt;strong&gt;HTTP Referer header.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
It might look like just another technical detail, but it plays a key role in traffic analysis, marketing performance, and even web security.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the HTTP Referer?
&lt;/h2&gt;

&lt;p&gt;The Referer header is a part of the HTTP request that tells the destination website which page the user came from.  &lt;/p&gt;

&lt;p&gt;If I click a link to &lt;code&gt;dev.to&lt;/code&gt; from a post on LinkedIn, the Referer header in the request will show &lt;code&gt;linkedin.com&lt;/code&gt;&lt;br&gt;
That’s how dev.to knows I came from LinkedIn.&lt;/p&gt;

&lt;p&gt;Here's what that looks like in a browser's developer tools:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatsb6zzgaskqdve1k4zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatsb6zzgaskqdve1k4zw.png" alt=" " width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why you should care about referer?
&lt;/h2&gt;

&lt;p&gt;Let’s be honest: throwing money at ads without knowing where traffic comes from is just bad business.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Marketing Teams Love It
&lt;/h3&gt;

&lt;p&gt;The Referer header helps you:&lt;/p&gt;

&lt;p&gt;✅Track user journeys and discover which platforms bring real traffic&lt;br&gt;
✅ Evaluate the ROI of newsletters, affiliates, and cross-promotions&lt;br&gt;
✅ Detect unusual traffic spikes from unexpected sources&lt;/p&gt;

&lt;p&gt;For example, referers like &lt;code&gt;instagram.com&lt;/code&gt;, or &lt;code&gt;linkedin.com&lt;/code&gt; can show you exactly which channel is paying off.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Security Teams Use It, Too
&lt;/h3&gt;

&lt;p&gt;Referer isn’t just a marketer’s tool—it’s also useful for basic security and traffic control:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;CSRF Protection&lt;/strong&gt;: Some systems check the Referer to verify that requests came from within the same site.&lt;br&gt;
✅&lt;strong&gt;Hotlink Protection&lt;/strong&gt;: You can block other websites from embedding your images or files by inspecting their referer.&lt;br&gt;
✅ &lt;strong&gt;Access Control&lt;/strong&gt;: Internal dashboards or tools may block access if the request originates from an external referer.&lt;/p&gt;

&lt;p&gt;While it's not foolproof, it adds an extra layer of context that can help make smarter decisions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Can Referer Be Trusted?
&lt;/h2&gt;

&lt;p&gt;Short answer: &lt;strong&gt;not entirely.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Referer can be:&lt;/p&gt;

&lt;p&gt;Manually modified with tools like curl or browser devtools&lt;/p&gt;

&lt;p&gt;Spoofed by browser extensions or automated bots&lt;/p&gt;

&lt;p&gt;So don’t rely on it for authentication or critical security checks.&lt;br&gt;
But as a supporting signal, it’s still very helpful.&lt;/p&gt;

&lt;p&gt;For example, you might notice that a high volume of suspicious traffic is coming with a spoofed referer. That insight alone could guide further investigation or trigger automated defenses.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The HTTP Referer is often overlooked but offers valuable insights for both marketing and security. While it's not bulletproof, it can enhance visibility, detect anomalies, and protect resources when used wisely.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Building an analytics dashboard?&lt;br&gt;&lt;br&gt;
Preventing bandwidth theft on your CDN?&lt;br&gt;&lt;br&gt;
Filtering suspicious access to internal tools?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Referer header might just be the simple trick you're missing.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How Do You Measure Web Performance—and What Should You Actually Look At?</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Sat, 24 May 2025 03:23:52 +0000</pubDate>
      <link>https://forem.com/ellapark/how-do-you-measure-web-performance-and-what-should-you-actually-look-at-n0b</link>
      <guid>https://forem.com/ellapark/how-do-you-measure-web-performance-and-what-should-you-actually-look-at-n0b</guid>
      <description>&lt;p&gt;Everyone knows that website speed is important. But when we say a site is “slow,” what does that really mean?&lt;/p&gt;

&lt;p&gt;Does the page take too long to load? Is there a delay when clicking a button? Or does the entire experience just feel sluggish?&lt;br&gt;
These are all different issues—and they require different ways to measure and improve.&lt;/p&gt;

&lt;p&gt;That’s why it's crucial to use the right tools and metrics to evaluate performance in a measurable, structured way.&lt;br&gt;
In this post, we’ll look at some of the most widely used tools for measuring web performance, and break down the key metrics you should be paying attention to.&lt;/p&gt;




&lt;h1&gt;
  
  
  Popular Tools for Measuring Web Performance
&lt;/h1&gt;

&lt;p&gt;Before optimizing anything, you need to measure it. Here are some tools commonly used in real-world projects:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔸 PageSpeed Insights&lt;/strong&gt;&lt;br&gt;
Google’s official tool and a great place to start.&lt;br&gt;
It provides both field data (from real users) and lab data (simulated tests), giving you a balanced view of your site’s performance.&lt;br&gt;
It’s beginner-friendly and aligns well with SEO best practices.&lt;/p&gt;

&lt;p&gt;👍 Combines real-world and simulated data&lt;br&gt;
👎 Limited control over test conditions (e.g., device, network)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔸 Lighthouse&lt;/strong&gt;&lt;br&gt;
Built right into Chrome DevTools, Lighthouse runs in-depth audits covering performance, accessibility, SEO, and more.&lt;br&gt;
It’s especially useful during development or in CI pipelines.&lt;/p&gt;

&lt;p&gt;👍 Easy access, broad coverage&lt;br&gt;
👎 Results may vary depending on your device and network&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔸 WebPageTest&lt;/strong&gt;&lt;br&gt;
A more advanced tool that lets you choose test locations, browsers, and simulate network conditions.&lt;br&gt;
It gives you waterfall charts, filmstrip views, and detailed breakdowns that help you pinpoint bottlenecks.&lt;/p&gt;

&lt;p&gt;👍 Highly customizable and detailed&lt;br&gt;
👎 Slightly steeper learning curve&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔸 Chrome DevTools – Performance Tab&lt;/strong&gt;&lt;br&gt;
This tool digs deep into what the browser is doing—JavaScript execution, layout, painting, and more.&lt;br&gt;
It’s excellent for identifying exact pain points in rendering and scripting.&lt;/p&gt;

&lt;p&gt;👍 Extremely detailed, good for diagnosing issues&lt;br&gt;
👎 More suitable for experienced developers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔸 Real User Monitoring (RUM)&lt;/strong&gt;&lt;br&gt;
RUM collects data from actual users as they interact with your site.&lt;br&gt;
It gives insight into real-world performance by browser, device, and location.&lt;/p&gt;

&lt;p&gt;Some examples include: New Relic, Datadog, SpeedCurve&lt;/p&gt;

&lt;p&gt;👍 Real-world insight into live performance&lt;br&gt;
👎 Requires setup and potentially added cost&lt;/p&gt;




&lt;h1&gt;
  
  
  Key Web Performance Metrics
&lt;/h1&gt;

&lt;p&gt;No matter what tool you use, most evaluations boil down to a few important numbers.&lt;br&gt;
Google’s Core Web Vitals focus on what matters most to users—and can even affect your SEO rankings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ TTFB (Time To First Byte)&lt;/strong&gt;&lt;br&gt;
What it means: Time from sending a request to receiving the first byte from the server&lt;br&gt;
Why it matters: A slow TTFB often points to backend or network delays&lt;br&gt;
Tip: Look into DNS resolution, TLS handshake, and backend response times&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ LCP (Largest Contentful Paint)&lt;/strong&gt;&lt;br&gt;
What it means: Time it takes for the largest visible element (like a hero image or heading) to render&lt;br&gt;
Why it matters: Reflects when the user sees the main content&lt;br&gt;
Tip: Compress images, use modern formats, and minimize render-blocking scripts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ CLS (Cumulative Layout Shift)&lt;/strong&gt;&lt;br&gt;
What it means: How much the layout unexpectedly shifts during loading&lt;br&gt;
Why it matters: Sudden shifts can cause users to misclick and reduce trust&lt;br&gt;
Tip: Set size attributes for images, avoid injecting elements at the top&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ FID (First Input Delay)&lt;/strong&gt;&lt;br&gt;
What it means: Time between a user’s first interaction (like a click) and when the browser responds&lt;br&gt;
Why it matters: Impacts how responsive the site feels&lt;br&gt;
Tip: Minimize long-running JavaScript during the initial load&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ INP (Interaction to Next Paint)&lt;/strong&gt;&lt;br&gt;
What it means: A newer metric measuring delays across all interactions—not just the first&lt;br&gt;
Why it matters: Gives a more complete picture of overall responsiveness&lt;br&gt;
Tip: Split heavy tasks, optimize event handlers, and keep main thread unblocked&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Improving web performance is more than speed—it’s about smooth, pleasant experiences.&lt;/p&gt;

&lt;p&gt;Start simple: test with PageSpeed Insights or Lighthouse.&lt;br&gt;
Then explore tools like WebPageTest or real-user monitoring for deeper insights.&lt;/p&gt;

&lt;p&gt;No need to fix everything at once.&lt;br&gt;
Focus on one metric, improve step-by-step.&lt;/p&gt;

&lt;p&gt;Performance isn’t a checklist, but a continuous process—always begin with solid measurement.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>What Really Happens When You Hit "Play" on a Video?</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Thu, 08 May 2025 06:56:18 +0000</pubDate>
      <link>https://forem.com/ellapark/what-really-happens-when-you-hit-play-on-a-video-5903</link>
      <guid>https://forem.com/ellapark/what-really-happens-when-you-hit-play-on-a-video-5903</guid>
      <description>&lt;p&gt;Clicking the play button on Netflix or YouTube feels instant and effortless.&lt;br&gt;&lt;br&gt;
But behind that simple click lies a complex system working in real-time to deliver seamless, high-quality video.&lt;/p&gt;

&lt;p&gt;Video streaming isn't just file downloading — it's a dynamic process involving segmented delivery, adaptive bitrate logic, and encryption.&lt;/p&gt;

&lt;p&gt;In this post, we'll explore the inner workings of video streaming&lt;/p&gt;




&lt;h2&gt;
  
  
  1. It's Not a Single File — It's Chunks
&lt;/h2&gt;

&lt;p&gt;Streaming platforms don’t send one large &lt;code&gt;.mp4&lt;/code&gt; file.&lt;br&gt;&lt;br&gt;
Instead, the video is broken into small segments, typically 2 to 10 seconds long.&lt;/p&gt;

&lt;p&gt;This segmented approach enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Partial and on-demand loading
&lt;/li&gt;
&lt;li&gt;Faster seeking
&lt;/li&gt;
&lt;li&gt;Real-time quality switching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Depending on the protocol:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HLS (HTTP Live Streaming)&lt;/strong&gt; uses &lt;code&gt;.m3u8&lt;/code&gt; manifest and &lt;code&gt;.ts&lt;/code&gt; segments
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MPEG-DASH&lt;/strong&gt; uses &lt;code&gt;.mpd&lt;/code&gt; manifest and &lt;code&gt;.m4s&lt;/code&gt; segments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a two-hour movie may be split into thousands of segments.&lt;br&gt;&lt;br&gt;
The player fetches only what it needs, when it needs it.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Everything Starts With the Manifest
&lt;/h2&gt;

&lt;p&gt;Before playing anything, the player downloads a &lt;strong&gt;manifest file&lt;/strong&gt; — essentially a smart playlist.&lt;/p&gt;

&lt;p&gt;This file contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Available resolutions and bitrates
&lt;/li&gt;
&lt;li&gt;URLs for each media segment
&lt;/li&gt;
&lt;li&gt;Timeline and synchronization info
&lt;/li&gt;
&lt;li&gt;Audio and subtitle track metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The manifest serves as a blueprint.&lt;br&gt;&lt;br&gt;
The player uses it to decide what to download and how to assemble the video.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Adaptive Bitrate (ABR) in Action
&lt;/h2&gt;

&lt;p&gt;Streaming quality isn't fixed.&lt;br&gt;&lt;br&gt;
Modern players use &lt;strong&gt;Adaptive Bitrate (ABR)&lt;/strong&gt; algorithms to continuously optimize video playback.&lt;/p&gt;

&lt;p&gt;The player monitors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network bandwidth
&lt;/li&gt;
&lt;li&gt;Buffer health
&lt;/li&gt;
&lt;li&gt;Download speed
&lt;/li&gt;
&lt;li&gt;Playback interruptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on this, the player upgrades or downgrades video quality in real-time to prevent buffering.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Segment Downloading and Buffering
&lt;/h2&gt;

&lt;p&gt;After parsing the manifest, the player starts fetching video segments.&lt;br&gt;&lt;br&gt;
These are often requested using &lt;strong&gt;HTTP range requests&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Segments are passed into the browser’s &lt;strong&gt;Media Source Extensions (MSE)&lt;/strong&gt; and appended to a buffer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ A full buffer ensures smooth playback
&lt;/li&gt;
&lt;li&gt;⛔ A low buffer may trigger rebuffering or quality drops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Players also &lt;strong&gt;prefetch upcoming segments&lt;/strong&gt; to stay ahead of the playback timeline.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Security and DRM
&lt;/h2&gt;

&lt;p&gt;To protect content, commercial platforms use &lt;strong&gt;Digital Rights Management (DRM)&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
Segments are encrypted and require decryption keys from a license server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common DRM systems:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Widevine (Google)
&lt;/li&gt;
&lt;li&gt;FairPlay (Apple)
&lt;/li&gt;
&lt;li&gt;PlayReady (Microsoft)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The manifest includes DRM metadata (e.g., &lt;code&gt;ContentProtection&lt;/code&gt; tags).&lt;br&gt;&lt;br&gt;
The player works with a DRM module to request a license, obtain the key, and decrypt the video before playback.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The Player Is Smarter Than You Think
&lt;/h2&gt;

&lt;p&gt;Modern players are not just display tools — they’re streaming engines.&lt;br&gt;
They are complex streaming engines that make real-time decisions to ensure smooth playback. &lt;/p&gt;

&lt;p&gt;From selection the best video segments to managing buffering and even syncing video with audio and subtitles, the player handles it all behind the scenes.&lt;/p&gt;

&lt;p&gt;Even with the same content and network conditions, differences in how players are implemented can significantly affect the viewing experience.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;When you hit "Plat", you're not just triggering a simple video download. What happens next is a series of real-time operations that kick in to deliver the content you want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The manifest is parsed&lt;/li&gt;
&lt;li&gt;The network is evaluated for optimal streaming conditions&lt;/li&gt;
&lt;li&gt;Segments are fetched as needed&lt;/li&gt;
&lt;li&gt;Content is decrypted, if necessary&lt;/li&gt;
&lt;li&gt;Finally, everything is synchronized for smooth playback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Streaming isn’t about downloading a video.&lt;br&gt;&lt;br&gt;
It’s about continuously delivering just the right content at the right time — under changing network conditions.&lt;/p&gt;

&lt;p&gt;✅ Understanding this helps explain why you sometimes see buffering, sudden quality drops, or playback errors.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>architecture</category>
    </item>
    <item>
      <title>HTTP/1.1 vs HTTP/2 vs HTTP/3 — Why Your Website Feels Faster (or Slower)</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 25 Apr 2025 08:26:14 +0000</pubDate>
      <link>https://forem.com/ellapark/http11-vs-http2-vs-http3-why-your-website-feels-faster-or-slower-2a2o</link>
      <guid>https://forem.com/ellapark/http11-vs-http2-vs-http3-why-your-website-feels-faster-or-slower-2a2o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When you’re trying to speed up a website, what comes to mind first? Minifying JavaScript? Compressing images? Caching?&lt;/p&gt;

&lt;p&gt;Those are all important — but there’s one lower-level detail that’s easy to miss: the version of the &lt;strong&gt;HTTP protocol&lt;/strong&gt; your website is using.&lt;/p&gt;

&lt;p&gt;The difference between HTTP/1.1, HTTP/2, and HTTP/3 isn't just technical trivia. It can have a real, measurable impact on how fast your site loads — especially in real-world network conditions like mobile or high-latency environments.&lt;/p&gt;

&lt;p&gt;Here’s what’s changed across the versions, and why it matters more than you might think.&lt;/p&gt;




&lt;h2&gt;
  
  
  HTTP/1.1 – The Old Reliable (With Some Rust)
&lt;/h2&gt;

&lt;p&gt;HTTP/1.1 ran the internet for over two decades. It’s rock-solid, widely supported, and still in use — but it’s not built for modern web complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runs over &lt;strong&gt;TCP&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Handles &lt;strong&gt;one request per connection&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;keep-alive&lt;/strong&gt;, but requests still get &lt;strong&gt;queued&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;No built-in compression or multiplexing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📌 Modern websites aren’t loading one or two files — they’re pulling in dozens of CSS, JS, images, and fonts.&lt;br&gt;&lt;br&gt;
Browsers work around this by opening multiple parallel connections (usually up to 6 per domain), which increases load on servers and network congestion.&lt;/p&gt;

&lt;p&gt;That’s why techniques like bundling, minifying, and image sprites were essential back in the day — they were workarounds for the protocol’s inefficiencies.&lt;/p&gt;


&lt;h2&gt;
  
  
  HTTP/2 – Smarter, But Still on TCP
&lt;/h2&gt;

&lt;p&gt;HTTP/2 improved performance significantly while still using TCP under the hood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does better:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supports &lt;strong&gt;multiplexing&lt;/strong&gt; — multiple requests in a single connection
&lt;/li&gt;
&lt;li&gt;Reduces &lt;strong&gt;application-level blocking&lt;/strong&gt; between requests
&lt;/li&gt;
&lt;li&gt;More efficient use of connections between client and server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This fixes a lot of the queueing problems from HTTP/1.1. But since HTTP/2 still relies on TCP, it inherits TCP’s limitations — most notably &lt;strong&gt;head-of-line blocking&lt;/strong&gt; at the transport layer. If one packet is lost, everything waits for it to be retransmitted.&lt;/p&gt;

&lt;p&gt;📌 Most modern browsers and CDNs support HTTP/2 by default, so if your server is configured properly, you might already be using it.&lt;/p&gt;


&lt;h2&gt;
  
  
  HTTP/3 – Rebuilt for the Modern Web
&lt;/h2&gt;

&lt;p&gt;HTTP/3 is the newest version, and it takes a bold step: ditching TCP entirely. It uses &lt;strong&gt;QUIC&lt;/strong&gt;, a transport protocol built on top of &lt;strong&gt;UDP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why that’s a big deal:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Faster connection setup&lt;/strong&gt; — supports 1-RTT or even 0-RTT handshakes
&lt;/li&gt;
&lt;li&gt;Avoids head-of-line blocking by handling streams independently
&lt;/li&gt;
&lt;li&gt;Built-in &lt;strong&gt;TLS 1.3&lt;/strong&gt;, fully integrated into the protocol
&lt;/li&gt;
&lt;li&gt;Designed for &lt;strong&gt;unstable or lossy networks&lt;/strong&gt; (like mobile and public Wi-Fi)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because QUIC is designed to handle individual streams separately, one lost packet doesn't block the others — meaning better performance on flaky connections.&lt;/p&gt;

&lt;p&gt;📌 Adoption is growing, but it's still not everywhere. Some CDNs support HTTP/3 at the edge, but still use HTTP/1.1 or HTTP/2 when talking to the origin server.&lt;/p&gt;


&lt;h2&gt;
  
  
  Quick Comparison Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;HTTP/1.1&lt;/th&gt;
&lt;th&gt;HTTP/2&lt;/th&gt;
&lt;th&gt;HTTP/3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Transport&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;TCP&lt;/td&gt;
&lt;td&gt;TCP&lt;/td&gt;
&lt;td&gt;UDP (QUIC)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multiplexing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Packet Loss Sensitivity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Connection Setup Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Slow&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;Very Fast&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mobile Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Poor&lt;/td&gt;
&lt;td&gt;Decent&lt;/td&gt;
&lt;td&gt;Excellent&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  How to Check Which HTTP Version You're Using
&lt;/h2&gt;

&lt;p&gt;You can check the HTTP version of any site using &lt;code&gt;curl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s2"&gt;"%{http_version}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-I&lt;/code&gt;: fetch headers only
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-w "%{http_version}"&lt;/code&gt;: print the HTTP version
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-s&lt;/code&gt;: silent mode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What you’ll see:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;2&lt;/code&gt; → HTTP/2
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1.1&lt;/code&gt; → HTTP/1.1
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To test for HTTP/3 (if your &lt;code&gt;curl&lt;/code&gt; version supports it):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; &lt;span class="nt"&gt;--http3&lt;/span&gt; https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not sure if your &lt;code&gt;curl&lt;/code&gt; can do HTTP/3? Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-V&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for &lt;code&gt;HTTP3&lt;/code&gt; in the &lt;strong&gt;Features&lt;/strong&gt; list.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Some curl builds don’t include HTTP/3 support by default.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  So Which One Should You Use?
&lt;/h2&gt;

&lt;p&gt;It depends on your users and your infrastructure:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Recommended Protocol&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stable, internal network&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;HTTP/2&lt;/strong&gt; is usually fine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mobile-heavy or global user base&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;HTTP/3&lt;/strong&gt; for better resilience&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Legacy systems or old clients&lt;/td&gt;
&lt;td&gt;Keep &lt;strong&gt;HTTP/1.1&lt;/strong&gt; as fallback&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Strict firewall environments (UDP blocked)&lt;/td&gt;
&lt;td&gt;Use &lt;strong&gt;HTTP/2&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;HTTP version upgrades don’t get as much attention as flashy frontend optimizations — but they should.&lt;/p&gt;

&lt;p&gt;In real-world conditions, especially on mobile or flaky networks, the version of HTTP your site is using can significantly affect how fast your content loads.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sometimes the bottleneck isn’t in your code — it’s in the protocol.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Take a minute to check what version you’re running. You might be surprised how much faster things can get with just one upgrade.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Improve and Validate Your CDN Performance with These HTTP Headers</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 18 Apr 2025 03:09:11 +0000</pubDate>
      <link>https://forem.com/ellapark/improve-and-validate-your-cdn-performance-with-these-http-headers-4gnm</link>
      <guid>https://forem.com/ellapark/improve-and-validate-your-cdn-performance-with-these-http-headers-4gnm</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you're looking to &lt;strong&gt;optimize the performance&lt;/strong&gt; of your website, CDN (Content Delivery Network) caching is one of the most powerful tools you can use. But how can you be sure it's working as expected?&lt;/p&gt;

&lt;p&gt;The key to improving your CDN’s performance lies in understanding and managing the &lt;strong&gt;HTTP headers&lt;/strong&gt; that control caching behavior. In this post, we’ll dive into 5 crucial HTTP headers that play a vital role in maximizing cache efficiency and overall website speed.&lt;/p&gt;

&lt;p&gt;By properly configuring and monitoring these headers, you can ensure your CDN is delivering content as quickly and efficiently as possible.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ 5 Key HTTP Headers for Optimizing CDN Performance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cache-Control&lt;/strong&gt; – Set caching policies effectively&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content-Type&lt;/strong&gt; – Ensure proper content delivery&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content-Encoding&lt;/strong&gt; – Enable efficient content compression&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;X-Cache&lt;/strong&gt; – Check cache hit or miss status&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;X-Cache-Key&lt;/strong&gt; – Identify the cache key used for content storage&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  ✍️ Understanding Each Header + Practical Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Cache-Control&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What It Does:&lt;/strong&gt; Controls how both the CDN and browser cache content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why It’s Important for Performance:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Proper cache policies can prevent unnecessary server requests and drastically reduce load times.&lt;/li&gt;
&lt;li&gt;Misconfiguring it (e.g., setting &lt;code&gt;no-cache&lt;/code&gt;) can lead to content being fetched from the server every time, slowing down your site.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pro Tip:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;For static assets: &lt;code&gt;public, max-age=31536000, immutable&lt;/code&gt; ensures these assets are cached for a long period and won’t be revalidated unnecessarily.&lt;/li&gt;
&lt;li&gt;For dynamic content (like HTML): &lt;code&gt;no-cache, must-revalidate&lt;/code&gt; helps ensure content is updated when needed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Check:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.com/path/to/resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the &lt;code&gt;Cache-Control&lt;/code&gt; header in the response.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Content-Type&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What It Does:&lt;/strong&gt; Specifies the type of content being served (e.g., &lt;code&gt;text/html&lt;/code&gt;, &lt;code&gt;application/javascript&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why It’s Important for Performance:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Ensures the right content is served to the right browser, which helps avoid errors that could slow down the site.&lt;/li&gt;
&lt;li&gt;Misconfigurations can result in the wrong MIME type being sent, leading to failed or inefficient caching.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pro Tip:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Always set the correct MIME type (&lt;code&gt;application/javascript&lt;/code&gt;, &lt;code&gt;text/css&lt;/code&gt;, etc.).&lt;/li&gt;
&lt;li&gt;When using CloudFront + S3, manually confirm the &lt;code&gt;Content-Type&lt;/code&gt; header to prevent caching issues.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Check:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.com/path/to/resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the &lt;code&gt;Content-Type&lt;/code&gt; header.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;Content-Encoding&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What It Does:&lt;/strong&gt; Tells if the content is compressed (e.g., &lt;code&gt;gzip&lt;/code&gt;, &lt;code&gt;brotli&lt;/code&gt;) to reduce bandwidth usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why It’s Important for Performance:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Compressing content significantly reduces file sizes, allowing for faster load times and improved caching efficiency.&lt;/li&gt;
&lt;li&gt;Incorrectly serving compressed content to clients that don’t support it can cause issues.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pro Tip:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Enable automatic compression on your CDN for static assets.&lt;/li&gt;
&lt;li&gt;Ensure that both client and server support the same encoding methods (e.g., gzip, brotli).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Check:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; &lt;span class="nt"&gt;--compressed&lt;/span&gt; https://example.com/path/to/resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the &lt;code&gt;Content-Encoding&lt;/code&gt; header.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;X-Cache&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What It Does:&lt;/strong&gt; Shows whether the content was served from the CDN cache or fetched from the origin server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why It’s Important for Performance:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If a cache miss occurs, it means the CDN has to fetch content from the origin server, which slows down response times.&lt;/li&gt;
&lt;li&gt;Monitoring this header helps you track cache performance and optimize caching rules.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Typical Values:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;HIT&lt;/code&gt;: The content was served from the cache (optimal performance).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MISS&lt;/code&gt;: The content was fetched from the origin server (less optimal).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EXPIRED&lt;/code&gt;: The cached content expired, but a revalidation took place.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BYPASS&lt;/code&gt;: Content was not cached at all.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Check:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.com/path/to/resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the &lt;code&gt;X-Cache&lt;/code&gt; header in the response.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. &lt;strong&gt;X-Cache-Key&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What It Does:&lt;/strong&gt; Identifies the cache key used to store the content in the CDN’s cache.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why It’s Important for Performance:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;The cache key determines how content is stored and retrieved from the cache.&lt;/li&gt;
&lt;li&gt;A poorly designed cache key can result in inefficient caching and lower hit rates.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Pro Tip:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Ensure the cache key is unique enough to avoid cache collisions and unnecessary cache misses.&lt;/li&gt;
&lt;li&gt;Some CDNs expose this key directly (e.g., Cloudflare’s &lt;code&gt;CF-Cache-Status&lt;/code&gt;), while others may require access to logs.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Check:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.com/path/to/resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the &lt;code&gt;X-Cache-Key&lt;/code&gt; header (or platform-specific variations like &lt;code&gt;X-Akamai-Cache-Key&lt;/code&gt; or &lt;code&gt;CF-Cache-Status&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;By understanding and configuring these HTTP headers, you can greatly improve your CDN’s caching efficiency and the overall performance of your website. Ensuring that content is cached properly reduces server load, minimizes latency, and speeds up content delivery, ultimately enhancing user experience!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cdn</category>
    </item>
    <item>
      <title>Slow and Secure: Why VPNs Reduce Your Internet Speed</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 11 Apr 2025 07:43:18 +0000</pubDate>
      <link>https://forem.com/ellapark/slow-and-secure-why-vpns-reduce-your-internet-speed-3l23</link>
      <guid>https://forem.com/ellapark/slow-and-secure-why-vpns-reduce-your-internet-speed-3l23</guid>
      <description>&lt;p&gt;VPNs are incredibly useful. They help keep your online activity &lt;strong&gt;private&lt;/strong&gt;, secure your connection on public Wi-Fi, and let you access content from other countries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnq9cf3gah4lvmb2dfoe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnq9cf3gah4lvmb2dfoe.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if you’ve ever used one, you’ve probably noticed—they can make your internet feel noticeably slower.&lt;/p&gt;

&lt;p&gt;Why does that happen? And more importantly, can you do anything about it?&lt;br&gt;
Let’s break it down.&lt;/p&gt;




&lt;h2&gt;
  
  
  So, What’s Slowing Things Down?
&lt;/h2&gt;

&lt;p&gt;When you connect to the internet through a VPN, your data doesn’t take the usual direct route. Instead, it goes through several extra steps—and those steps are mostly responsible for the drop in speed.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Encryption Takes Processing Power
&lt;/h3&gt;

&lt;p&gt;One of the core features of a VPN is encryption. It protects every packet of your data, making it nearly impossible for hackers, ISPs, or governments to intercept or monitor your traffic.&lt;/p&gt;

&lt;p&gt;But encryption comes at a cost—it uses CPU and network resources.&lt;/p&gt;

&lt;p&gt;💻 Newer devices can usually handle this without issue&lt;/p&gt;

&lt;p&gt;🧓 Older hardware may experience slower performance, especially during downloads or video streaming&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Your Data Takes the Long Way Around
&lt;/h3&gt;

&lt;p&gt;Without a VPN, your internet traffic goes straight to its destination.&lt;br&gt;
With a VPN, it first gets routed through a VPN server—then to the final destination.&lt;/p&gt;

&lt;p&gt;This &lt;strong&gt;extra stop&lt;/strong&gt; adds both &lt;strong&gt;distance&lt;/strong&gt; and &lt;strong&gt;latency.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The farther away the server is, the more delay you’ll notice—especially for time-sensitive activities like gaming, video calls, or live streaming.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Crowded VPN Servers
&lt;/h3&gt;

&lt;p&gt;All of your internet traffic passes through the VPN server. If that server is handling too many users at once, things can slow down quickly.&lt;/p&gt;

&lt;p&gt;This is a common issue with &lt;strong&gt;free VPN services&lt;/strong&gt;, which usually have limited server capacity and a large user base. But even some paid VPNs can slow down during peak hours if their infrastructure isn’t robust enough.&lt;/p&gt;

&lt;p&gt;Bottom line: server congestion equals slower speeds.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. The VPN Protocol You’re Using
&lt;/h3&gt;

&lt;p&gt;Not all VPNs are created equal—especially when it comes to the underlying protocol they use. The &lt;strong&gt;VPN protocol&lt;/strong&gt; determines how your data is transmitted and secured, and it can have a major impact on performance.&lt;/p&gt;

&lt;p&gt;Here’s a quick comparison of the most common protocols:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Protocol&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WireGuard&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A modern, lightweight protocol built for speed&lt;/td&gt;
&lt;td&gt;Very fast, low latency, secure, easy setup&lt;/td&gt;
&lt;td&gt;Newer, not yet supported by all devices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IKEv2/IPSec&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Efficient and stable, especially for mobile&lt;/td&gt;
&lt;td&gt;Great for mobile use, quick reconnects&lt;/td&gt;
&lt;td&gt;Can be blocked by strict firewalls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenVPN (UDP)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A widely used, highly secure protocol&lt;/td&gt;
&lt;td&gt;Strong encryption, flexible&lt;/td&gt;
&lt;td&gt;Slightly slower due to higher overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;💡 If your VPN allows it, try switching protocols and see which one works best for your device and network&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Speed Things Up
&lt;/h2&gt;

&lt;p&gt;If your VPN is dragging your speed down, here are a few tips to help improve performance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Choose a server close to your physical location.&lt;/strong&gt; Shorter distance means lower latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a faster protocol&lt;/strong&gt; like WireGuard if your VPN supports it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid free VPNs&lt;/strong&gt; if possible—they’re often slow due to overloaded servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable split tunneling.&lt;/strong&gt; This lets you route only specific apps (like your browser) through the VPN, while others (like downloads or games) use your normal connection.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;VPNs are a powerful tool for privacy, but they often come with a tradeoff in speed.&lt;/p&gt;

&lt;p&gt;The good news? A lot of that slowdown is manageable.&lt;br&gt;
With the right server, modern protocol, and a bit of smart configuration, you can stay secure without sacrificing performance.&lt;/p&gt;

&lt;p&gt;In the end, it’s all about balance:&lt;br&gt;
🔒 &lt;strong&gt;Privacy +&lt;/strong&gt; ⚡ &lt;strong&gt;Performance&lt;/strong&gt; = ✨ A smooth, secure internet experience&lt;/p&gt;

</description>
      <category>learning</category>
    </item>
    <item>
      <title>SFTP, FTPS : The Smarter Way to Transfer Files</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 04 Apr 2025 08:12:03 +0000</pubDate>
      <link>https://forem.com/ellapark/is-your-ftp-secure-a-look-at-sftp-ftps-51ne</link>
      <guid>https://forem.com/ellapark/is-your-ftp-secure-a-look-at-sftp-ftps-51ne</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;FTP transmits data in plain text, making it highly vulnerable to interception and attacks. Due to these security risks, it is now considered outdated and rarely used in modern environments.&lt;/p&gt;

&lt;p&gt;To address these security risks, SFTP (SSH File Transfer Protocol) and FTPS (FTP Secure over SSL/TLS) have become the standard alternatives. These protocols encrypt data transmissions and enforce stronger authentication mechanisms, making file transfers significantly more secure.&lt;/p&gt;

&lt;p&gt;But how secure are these alternatives? Do they fully mitigate security risks, or do they introduce new complexities? This post will cover:&lt;/p&gt;

&lt;p&gt;🔍 The security risks of unencrypted file transfers&lt;/p&gt;

&lt;p&gt;🔍 How SFTP and FTPS enhance security—but with trade-offs&lt;/p&gt;

&lt;p&gt;🔍 Best practices for ensuring truly secure file transfers&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Outdated and Insecure: Why You Should Move Away from FTP&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;FTP was once a widely used method for transferring files, but it no longer meets modern security requirements. It was designed in an era when cybersecurity wasn’t a major concern, and as a result, it lacks critical protections against today’s threats.&lt;/p&gt;

&lt;p&gt;Here’s why FTP is no longer a secure option:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No Encryption&lt;/strong&gt; – Standard FTP transmits data in plain text, making it vulnerable to eavesdropping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brute Force Attacks&lt;/strong&gt; – Weak authentication allows attackers to guess login credentials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Directory Traversal Risks&lt;/strong&gt; – Misconfigured servers can let attackers access unauthorized files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTP Bounce Attacks&lt;/strong&gt; – Attackers can exploit misconfigured FTP servers to relay malicious traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of these security risks, major browsers like Chrome and Firefox have removed support for FTP, and most organizations have moved to SFTP (SSH File Transfer Protocol) or FTPS (FTP Secure over SSL/TLS) for encrypted file transfers.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;SFTP vs. FTPS: Which One Is Right for You?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Both SFTP and FTPS introduce encryption and authentication mechanisms to enhance security, but they differ in key ways.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;SFTP (SSH File Transfer Protocol)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt; Uses SSH (port 22) to encrypt file transfers.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strong encryption protects against &lt;strong&gt;packet sniffing&lt;/strong&gt; and &lt;strong&gt;MITM (Man-in-the-Middle) attacks&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports public key authentication&lt;/strong&gt;, eliminating reliance on passwords.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resumable transfers&lt;/strong&gt; are supported, making it ideal for large files.&lt;/li&gt;
&lt;li&gt;Can be configured with &lt;strong&gt;chroot jail&lt;/strong&gt;, isolating users from broader system access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❌ &lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;More complex user management&lt;/strong&gt;, though restricted SFTP-only accounts help mitigate this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No built-in MFA&lt;/strong&gt;, but SSH key authentication improves security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Higher encryption overhead&lt;/strong&gt;, which may introduce latency for large data transfers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;FTPS (FTP Secure over SSL/TLS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt; Enhances standard FTP with SSL/TLS encryption.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TLS encryption secures credentials &amp;amp; data&lt;/strong&gt; from interception.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier migration&lt;/strong&gt; for organizations already using FTP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSL certificates&lt;/strong&gt; can provide additional authentication security.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❌ &lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not all FTP clients support FTPS&lt;/strong&gt;, and compatibility issues may arise between &lt;strong&gt;Explicit FTPS (FTPES) and Implicit FTPS (FTPS)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firewall/NAT issues&lt;/strong&gt;, as FTPS requires multiple ports for control and data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No built-in MFA&lt;/strong&gt;, making additional authentication layers necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outdated TLS versions can weaken encryption&lt;/strong&gt; if not properly maintained.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;SFTP vs. FTPS – A Quick Comparison&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;SFTP&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;FTPS&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Encryption&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SSH-based (AES, RSA, etc.)&lt;/td&gt;
&lt;td&gt;TLS/SSL-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Port&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;21 + random data ports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User Management&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Can be restricted via &lt;code&gt;chroot jail&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Standard FTP user management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Firewall Issues&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Minimal&lt;/td&gt;
&lt;td&gt;Requires additional configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Supports Public Key Authentication?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Supports MFA?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌ No (but SSH keys enhance security)&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Resumable Transfers?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Best Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Secure enterprise file transfers, cloud environments&lt;/td&gt;
&lt;td&gt;Migrating from legacy FTP environments with added security&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;File transfer security has evolved significantly, and older protocols like FTP no longer align with modern security standards. SFTP and FTPS provide essential encryption and authentication improvements, making them far more reliable choices for secure data exchange.&lt;/p&gt;

&lt;p&gt;🔹 For security-first environments with minimal firewall complexity, SFTP is a strong choice.&lt;/p&gt;

&lt;p&gt;🔹 For organizations with legacy systems, FTPS can provide a structured transition while enhancing security.&lt;/p&gt;

&lt;p&gt;However, protocol choice is just one part of a comprehensive security approach. To truly protect sensitive data, organizations should also implement:&lt;/p&gt;

&lt;p&gt;✅ Multi-Factor Authentication (MFA) – Reducing unauthorized access risks.&lt;/p&gt;

&lt;p&gt;✅ File Integrity Verification – Detecting tampering with cryptographic hashes like SHA-256.&lt;/p&gt;

&lt;p&gt;✅ Strict Access Controls – Enforcing least privilege principles.&lt;/p&gt;

&lt;p&gt;✅ Managed File Transfer (MFT) Solutions – Providing automation and centralized security policies.&lt;/p&gt;

&lt;p&gt;Ultimately, securing file transfers requires more than just encryption—it demands a proactive approach to authentication, integrity, and access control to keep up with today’s evolving threat landscape.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>JWT vs. PASETO: Which One is Right for You?</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 21 Mar 2025 06:02:08 +0000</pubDate>
      <link>https://forem.com/ellapark/jwt-vs-paseto-which-one-is-right-for-you-2e40</link>
      <guid>https://forem.com/ellapark/jwt-vs-paseto-which-one-is-right-for-you-2e40</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you work with authentication in web applications, you’ve probably used &lt;strong&gt;JSON Web Tokens (JWT)&lt;/strong&gt;. JWT is a widely adopted standard, but it has its &lt;strong&gt;complexities and potential security pitfalls&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As an alternative, &lt;strong&gt;PASETO (Platform-Agnostic Security Tokens)&lt;/strong&gt; has emerged, designed to simplify secure token usage while enforcing strong cryptographic defaults. PASETO aims to reduce the cognitive load involved in securing tokens by removing many of the configuration steps that JWT requires.&lt;/p&gt;

&lt;p&gt;But dose the promise of enhanced security and simplicity mean it’s time to switch from JWT to PASETO?&lt;/p&gt;

&lt;p&gt;In this post, we’ll break down the &lt;strong&gt;key differences between JWT and PASETO&lt;/strong&gt;, discuss their &lt;strong&gt;strengths and weaknesses&lt;/strong&gt;, and give you some things to think about before deciding if a switch is right for your project.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;How JWT Works and Its Common Pitfalls&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. JWT Offers Flexibility, But at a Cost&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JWT supports multiple algorithms, giving developers the option to choose between &lt;strong&gt;HMAC, RSA, and ECDSA&lt;/strong&gt; for signing and encryption. This flexibility, while useful, also introduces risks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm Confusion Attacks:&lt;/strong&gt; If a developer mistakenly sets the algorithm to &lt;code&gt;'none'&lt;/code&gt;, signature verification is skipped entirely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Management Complexity:&lt;/strong&gt; Handling &lt;strong&gt;private/public key pairs&lt;/strong&gt; securely requires extra effort, increasing the risk of misconfiguration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. JWT Payloads Are Not Encrypted By Default&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JWT uses Base64 URL-safe encoding for the payload, but this is &lt;strong&gt;not encryption&lt;/strong&gt;—it is simply an encoding method. This means that unless explicitly encrypted (e.g., via JWE - JSON Web Encryption), the payload remains readable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Even if a token is signed, anyone intercepting it can see its contents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workaround:&lt;/strong&gt; Developers must implement additional encryption, adding complexity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Verification Requires Extra Implementation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;With JWT, servers need to:&lt;/p&gt;

&lt;p&gt;✅ Validate the token’s signature&lt;/p&gt;

&lt;p&gt;✅ Check expiration time (&lt;code&gt;exp&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;✅ Ensure the correct algorithm is used&lt;/p&gt;

&lt;p&gt;This extra verification code opens the door for potential mistakes, which could compromise security.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;How PASETO Differs from JWT&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Fixed Cryptographic Algorithms&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Unlike JWT, which allows multiple cryptographic options, &lt;strong&gt;PASETO enforces secure defaults&lt;/strong&gt; for each version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;V2 (widely used)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Ed25519&lt;/strong&gt; for signing (public-key cryptography)&lt;br&gt;
✅ &lt;strong&gt;XChaCha20-Poly1305&lt;/strong&gt; for encryption (symmetric encryption)&lt;/p&gt;

&lt;p&gt;By &lt;strong&gt;removing algorithm flexibility&lt;/strong&gt;, PASETO prevents misconfigurations like &lt;strong&gt;weak signing algorithms or 'none' attacks'&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2. No Algorithm Confusion Attacks&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;PASETO eliminates algorithm confusion attacks by not storing cryptographic details in the token itself. Unlike UWT, which includes the algorithm in the header, PASETO &lt;strong&gt;predefines the cryptographic method&lt;/strong&gt; for each version, ensuring security.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;JWT Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"alg"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"RS256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"typ"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"JWT"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Attackers can tamper with this and attempt &lt;strong&gt;downgrade attacks&lt;/strong&gt;.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;PASETO Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ The cryptographic method is &lt;strong&gt;predefined&lt;/strong&gt; based on the version, eliminating this risk.&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Built-in Support for Encryption&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;PASETO supports both:&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Public-key signed tokens&lt;/strong&gt; (&lt;code&gt;public&lt;/code&gt;) → Like JWT's &lt;strong&gt;JWS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Symmetric encrypted tokens&lt;/strong&gt; (&lt;code&gt;local&lt;/code&gt;) → Like JWT's &lt;strong&gt;JWE&lt;/strong&gt;, but &lt;strong&gt;simpler&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This means &lt;strong&gt;sensitive data can be protected more easily&lt;/strong&gt; without requiring extra encryption layers.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;When JWT Might Still Be a Better Choice&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Compatibility with Existing Systems&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JWT is the &lt;strong&gt;default choice&lt;/strong&gt; for:&lt;/p&gt;

&lt;p&gt;✅ OAuth 2.0 and OpenID Connect (OIDC)&lt;/p&gt;

&lt;p&gt;✅ Authentication providers (Auth0, Firebase, AWS Cognito)&lt;/p&gt;

&lt;p&gt;✅ Many frameworks and libraries&lt;/p&gt;

&lt;p&gt;Switching to PASETO might require rewriting authentication logic or customizing integrations, which could introduce significant overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Larger Ecosystem and Community Support&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JWT has been around longer, meaning:&lt;/p&gt;

&lt;p&gt;✔ More &lt;strong&gt;libraries and tools&lt;/strong&gt; exist across programming languages&lt;/p&gt;

&lt;p&gt;✔ More &lt;strong&gt;third-party services&lt;/strong&gt; natively support it&lt;/p&gt;

&lt;p&gt;PASETO is growing, but its adoption is still limited compared to JWT, meaning it may not yet have the same breadth of community and ecosystem support.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Not All Applications Need PASETO’s Features&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your system already encrypts sensitive data before placing it in JWT, and you follow best practices for validation and key management, JWT can still be a secure option. &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;JWT vs PASETO: Key Differences at a Glance&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;JWT&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;PASETO&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cryptographic Flexibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiple algorithms (HMAC, RSA, ECDSA)&lt;/td&gt;
&lt;td&gt;Fixed algorithms (Ed25519, XChaCha20)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Algorithm Confusion Attacks&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Possible (due to algorithm in the header)&lt;/td&gt;
&lt;td&gt;Not possible (predefined in version)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Encryption Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not built-in, requires extra implementation&lt;/td&gt;
&lt;td&gt;Built-in support for both public-key and symmetric encryption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity of Key Management&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Higher (public/private keys)&lt;/td&gt;
&lt;td&gt;Simplified (secure defaults)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ecosystem Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Large, mature ecosystem&lt;/td&gt;
&lt;td&gt;Smaller, growing community&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion: Should You Switch to PASETO?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It depends.&lt;/p&gt;

&lt;p&gt;If stronger security with minimal configuration is your priority, PASETO offers clear advantages over JWT by:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Eliminating weak algorithm choices&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Preventing algorithm confusion attacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Providing built-in encryption&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;However, if your application relies on JWT-based authentication frameworks, migrating may introduce challenges such as:&lt;/p&gt;

&lt;p&gt;❌ &lt;strong&gt;Rewriting existing authentication flows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;❌ &lt;strong&gt;Limited third-party support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ultimately, PASETO is not a direct replacement for JWT, but rather an alternative designed to reduce common security pitfalls. Carefully consider your project’s security needs, infrastructure, and compatibility before making the switch.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>architecture</category>
      <category>jwt</category>
    </item>
    <item>
      <title>CORS Done Wrong? Say Hello to Security Risks!</title>
      <dc:creator>Ella</dc:creator>
      <pubDate>Fri, 14 Mar 2025 05:11:29 +0000</pubDate>
      <link>https://forem.com/ellapark/cors-done-wrong-say-hello-to-security-risks-25gg</link>
      <guid>https://forem.com/ellapark/cors-done-wrong-say-hello-to-security-risks-25gg</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you build web applications, you often need to fetch data from different domains — whether it’s pulling information from an external API or loading resources from another server. But if you’ve ever run into a CORS error, you know how frustrating it can be!&lt;/p&gt;

&lt;p&gt;When it happens, many developers simply modify server settings to “make CORS work,” but &lt;strong&gt;misconfiguring CORS can introduce security risks&lt;/strong&gt;. In this article, we’ll explore &lt;strong&gt;how to properly configure CORS to enhance web security&lt;/strong&gt; rather than weaken it.&lt;/p&gt;




&lt;h2&gt;
  
  
  CORS vs. Same-Origin Policy (SOP)
&lt;/h2&gt;

&lt;p&gt;Before diving into CORS, let’s briefly discuss the &lt;strong&gt;Same-Origin Policy (SOP)&lt;/strong&gt;—a security feature that &lt;strong&gt;prevents web pages from making requests to a different origin (domain, protocol, or port)&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the Same-Origin Policy?
&lt;/h3&gt;

&lt;p&gt;SOP ensures that scripts running on one website cannot access resources from another site unless explicitly allowed. This prevents malicious websites from making unauthorized API requests on behalf of users, which helps protect against unauthorized access to resources.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
✅ A page hosted at &lt;code&gt;https://example.com&lt;/code&gt; &lt;strong&gt;can&lt;/strong&gt; access &lt;code&gt;https://example.com:8080&lt;/code&gt; if CORS allows it.&lt;br&gt;
❌ However, it &lt;strong&gt;cannot&lt;/strong&gt; access &lt;code&gt;https://api.another.com&lt;/code&gt; unless that server explicitly grants permission.&lt;/p&gt;

&lt;p&gt;While SOP enhances security, it also blocks legitimate cross-origin requests, making it difficult to fetch data from external APIs. To solve this, &lt;strong&gt;CORS (Cross-Origin Resource Sharing)&lt;/strong&gt; was introduced. &lt;/p&gt;


&lt;h2&gt;
  
  
  How CORS Works
&lt;/h2&gt;

&lt;p&gt;Whenever a browser makes a cross-origin request, it checks the CORS headers in the server’s response. If the response does not include the appropriate headers, the request is blocked.&lt;/p&gt;

&lt;p&gt;Here’s a quick breakdown of how it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple Requests&lt;/strong&gt;: Basic &lt;code&gt;GET&lt;/code&gt; requests without special headers are sent directly, and the browser checks the response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preflight Requests&lt;/strong&gt;: If the request includes custom headers, credentials, or methods like &lt;code&gt;PUT&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt;, the browser first sends an &lt;strong&gt;OPTIONS&lt;/strong&gt; request. If the server responds correctly, the actual request is sent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxao4orfo73sg0k6zjpjp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxao4orfo73sg0k6zjpjp.jpg" alt=" " width="800" height="796"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some key CORS headers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt;: Specifies allowed domains ( means any domain, which can be risky).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Access-Control-Allow-Methods&lt;/code&gt;: Defines allowed HTTP methods (&lt;code&gt;GET, POST, DELETE&lt;/code&gt;, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Access-Control-Allow-Headers&lt;/code&gt;: Lists allowed custom headers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Access-Control-Allow-Credentials&lt;/code&gt;: Determines if cookies and authentication headers can be included.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Security Risks of Poor CORS Configuration
&lt;/h2&gt;

&lt;p&gt;Many developers use &lt;strong&gt;relaxed CORS settings&lt;/strong&gt; just to get things working, but this can create serious security vulnerabilities.&lt;/p&gt;
&lt;h3&gt;
  
  
  🚨 Misconfigurations That Weaken Security
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Allowing All Origins ()&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Access-Control-Allow-Origin: *&lt;/code&gt; allows &lt;strong&gt;any&lt;/strong&gt; website to access your API.&lt;/li&gt;
&lt;li&gt;This is especially dangerous when combined with &lt;code&gt;Access-Control-Allow-Credentials: true&lt;/code&gt;, which exposes sensitive data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Excessive HTTP Methods&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Allowing all methods (&lt;code&gt;GET, POST, PUT, DELETE, OPTIONS&lt;/code&gt;) increases the risk of unintended actions.&lt;/li&gt;
&lt;li&gt;Example: If &lt;code&gt;DELETE&lt;/code&gt; is allowed, an attacker could delete user data via CSRF attacks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weak Preflight Request Handling&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Some servers improperly respond to preflight &lt;code&gt;OPTIONS&lt;/code&gt; requests, allowing unauthorized actions.&lt;/li&gt;
&lt;li&gt;Example: If &lt;code&gt;Access-Control-Allow-Methods: *&lt;/code&gt; is set, attackers can exploit hidden API methods.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  Best Practices for Secure CORS Configuration
&lt;/h2&gt;

&lt;p&gt;To enhance security, &lt;strong&gt;CORS should be configured with strict rules&lt;/strong&gt; instead of allowing everything.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Secure CORS Configuration
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Allow Specific Origins&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_header 'Access-Control-Allow-Origin' 'https://trusted.com';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of *, explicitly list trusted domains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restrict HTTP Methods&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_header 'Access-Control-Allow-Methods' 'GET, POST';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only allow methods necessary for your API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control Allowed Headers&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid allowing all headers ().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handle Preflight Requests Securely&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_header 'Access-Control-Max-Age' '3600';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Caches preflight responses to reduce unnecessary requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be Cautious with Credentials&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add_header 'Access-Control-Allow-Credentials' 'true';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only use this if absolutely necessary and &lt;strong&gt;never with  as the origin&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;CORS is essential for modern web applications, but a poorly configured CORS policy can &lt;strong&gt;expose your API to security risks&lt;/strong&gt;. Instead of just "fixing" CORS errors, always follow these best practices:&lt;/p&gt;

&lt;p&gt;✅ Allow only trusted origins.&lt;/p&gt;

&lt;p&gt;✅ Restrict HTTP methods and headers.&lt;/p&gt;

&lt;p&gt;✅ Secure preflight request handling.&lt;/p&gt;

&lt;p&gt;✅ Avoid using &lt;code&gt;*&lt;/code&gt; with credentials.&lt;/p&gt;

&lt;p&gt;By applying these principles, you can &lt;strong&gt;keep your web applications both functional and secure&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>programming</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
