<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Http on Commentary of Takao</title><link>https://takao.blog/zh-tw/tags/http/</link><description>Recent content in Http on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Commentary of Takao</copyright><lastBuildDate>Wed, 15 Jul 2026 22:01:08 +0900</lastBuildDate><atom:link href="https://takao.blog/zh-tw/tags/http/index.xml" rel="self" type="application/rss+xml"/><item><title>使用 DNS 預取和預連線加速資產加載</title><link>https://takao.blog/zh-tw/web/performance-dns-prefetch-preconnect/</link><pubDate>Wed, 15 Apr 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/performance-dns-prefetch-preconnect/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/performance-dns-prefetch-preconnect-zh-tw.png" alt="Featured image of post 使用 DNS 預取和預連線加速資產加載" /&gt;&lt;h2 id="介紹"&gt;介紹
&lt;/h2&gt;&lt;p&gt;每個外部資源（字體、腳本、映像、API 端點）都需要網路連線。 &lt;strong&gt;DNS 解析&lt;/strong&gt;、&lt;strong&gt;TCP 握手&lt;/strong&gt;和 &lt;strong&gt;TLS 協商&lt;/strong&gt;的開銷可能會導致頁面載入時間增加數百毫秒。 &lt;strong&gt;資源提示&lt;/strong&gt;如 &lt;code&gt;dns-prefetch&lt;/code&gt; 和 &lt;code&gt;preconnect&lt;/code&gt; 讓您告訴瀏覽器在實際需要資源之前&lt;strong&gt;提前&lt;/strong&gt;執行這些步驟。&lt;/p&gt;</description></item><item><title>CORS的工作原理以及修復訪問阻止錯誤</title><link>https://takao.blog/zh-tw/web/web-security-http-headers-cors/</link><pubDate>Mon, 15 Dec 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/web-security-http-headers-cors/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/web-security-http-headers-cors-zh-tw.png" alt="Featured image of post CORS的工作原理以及修復訪問阻止錯誤" /&gt;&lt;h2 id="介紹"&gt;介紹
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;CORS（來源資源共享）&lt;strong&gt;是一種瀏覽器安全，用於控制來自一個來源的網頁機制如何請求來自不同來源的資源。當&lt;code&gt;https://app.example.com&lt;/code&gt;處的前端嘗試從&lt;code&gt;https://api.example.org&lt;/code&gt;取得資料時，瀏覽器預設強制執行&lt;/strong&gt;同源策略&lt;/strong&gt;。 CORS提供了一種突破HTTP標頭來放寬此策略的受控方法。本文介紹了完整的CORS流程、預檢請求以及如何修復常見的跨存取阻止錯誤。&lt;/p&gt;</description></item><item><title>Secure Cookie Configuration: A Complete Web Developer 指南</title><link>https://takao.blog/zh-tw/web/secure-cookies/</link><pubDate>Mon, 09 Dec 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/zh-tw/web/secure-cookies/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/secure-cookies-zh-tw.png" alt="Featured image of post Secure Cookie Configuration: A Complete Web Developer 指南" /&gt;&lt;p&gt;Cookies remain one of the most frequently misconfigured security controls on the web. A single missing attribute can expose your application to session hijacking, CSRF, or cross-site information leakage. Modern browsers have pushed stricter defaults, but understanding each attribute and combining them correctly is essential for defense-in-depth.&lt;/p&gt;
&lt;p&gt;The core security attributes are &lt;code&gt;Secure&lt;/code&gt;, &lt;code&gt;HttpOnly&lt;/code&gt;, &lt;code&gt;SameSite&lt;/code&gt;, and the &lt;code&gt;__Host-&lt;/code&gt; / &lt;code&gt;__Secure-&lt;/code&gt; prefixes. Each serves a distinct purpose, and they work best when combined.&lt;/p&gt;</description></item></channel></rss>