<?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/es/tags/http/</link><description>Recent content in Http on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>es</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sun, 12 Jul 2026 04:12:51 +0900</lastBuildDate><atom:link href="https://takao.blog/es/tags/http/index.xml" rel="self" type="application/rss+xml"/><item><title>DNS-prefetch y Preconnect: Optimización de conexiones de red</title><link>https://takao.blog/es/web/performance-dns-prefetch-preconnect/</link><pubDate>Wed, 15 Apr 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/es/web/performance-dns-prefetch-preconnect/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/performance-dns-prefetch-preconnect-es.png" alt="Featured image of post DNS-prefetch y Preconnect: Optimización de conexiones de red" /&gt;&lt;p&gt;DNS-prefetch y preconnect reducen la latencia de conexiones a orígenes externos resolviendo DNS y estableciendo conexiones TCP/SSL antes de que se necesiten.&lt;/p&gt;
&lt;h2 id="dns-prefetch"&gt;DNS-prefetch
&lt;/h2&gt;&lt;p&gt;Resuelve DNS de dominios externos antes de que el navegador los solicite. Útil para recursos en CDNs, APIs y fuentes.&lt;/p&gt;
&lt;h2 id="preconnect"&gt;Preconnect
&lt;/h2&gt;&lt;p&gt;Además de DNS, establece la conexión TCP y el handshake TLS. Más costoso pero más efectivo. Usar solo para los orígenes más críticos (3-4 máximo).&lt;/p&gt;
&lt;h2 id="implementación"&gt;Implementación
&lt;/h2&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;link&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;rel&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;dns-prefetch&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;href&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;https://fonts.googleapis.com&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;link&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;rel&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;preconnect&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;href&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;https://fonts.gstatic.com&amp;#34;&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;crossorigin&lt;/span&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="cuándo-usar-cuál"&gt;Cuándo usar cuál
&lt;/h2&gt;&lt;p&gt;DNS-prefetch: recursos de terceros que no son críticos. Preconnect: orígenes que se usan en los primeros segundos de carga. Preconnect sin crossorigin puede filtrar datos.&lt;/p&gt;</description></item><item><title>HTTP Headers de seguridad y CORS</title><link>https://takao.blog/es/web/web-security-http-headers-cors/</link><pubDate>Mon, 15 Dec 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/es/web/web-security-http-headers-cors/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/web-security-http-headers-cors-es.png" alt="Featured image of post HTTP Headers de seguridad y CORS" /&gt;&lt;p&gt;Las cabeceras HTTP de seguridad protegen contra ataques comunes. CORS controla qué dominios pueden acceder a tus recursos desde el navegador.&lt;/p&gt;
&lt;h2 id="cabeceras-de-seguridad-esenciales"&gt;Cabeceras de seguridad esenciales
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;X-Content-Type-Options: nosniff&lt;/code&gt;, &lt;code&gt;X-Frame-Options: DENY&lt;/code&gt;, &lt;code&gt;X-XSS-Protection: 0&lt;/code&gt; (obsoleto). &lt;code&gt;Referrer-Policy&lt;/code&gt;, &lt;code&gt;Permissions-Policy&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="cors-cross-origin-resource-sharing"&gt;CORS (Cross-Origin Resource Sharing)
&lt;/h2&gt;&lt;p&gt;Controla qué orígenes pueden leer respuestas de tu API. &lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt;, &lt;code&gt;-Methods&lt;/code&gt;, &lt;code&gt;-Headers&lt;/code&gt;. Preflight con OPTIONS para solicitudes complejas.&lt;/p&gt;
&lt;h2 id="cors-en-apis"&gt;CORS en APIs
&lt;/h2&gt;&lt;p&gt;Para APIs públicas: &lt;code&gt;Access-Control-Allow-Origin: *&lt;/code&gt;. Para APIs privadas: lista blanca de orígenes. Credenciales requieren &lt;code&gt;Allow-Credentials: true&lt;/code&gt; y origen específico.&lt;/p&gt;</description></item><item><title>Cookies seguras: HttpOnly, Secure, SameSite</title><link>https://takao.blog/es/web/secure-cookies/</link><pubDate>Mon, 09 Dec 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/es/web/secure-cookies/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/secure-cookies-es.png" alt="Featured image of post Cookies seguras: HttpOnly, Secure, SameSite" /&gt;&lt;p&gt;Las cookies tienen atributos de seguridad que protegen contra XSS, CSRF y escuchas no autorizadas. Configurarlos correctamente es esencial.&lt;/p&gt;
&lt;h2 id="httponly"&gt;HttpOnly
&lt;/h2&gt;&lt;p&gt;Previene el acceso a la cookie desde JavaScript (&lt;code&gt;document.cookie&lt;/code&gt;). Bloquea robo de cookies via XSS. Esencial para cookies de sesión.&lt;/p&gt;
&lt;h2 id="secure"&gt;Secure
&lt;/h2&gt;&lt;p&gt;La cookie solo se envía en conexiones HTTPS. Nunca en HTTP. Protege contra ataques Man-in-the-Middle. Siempre activar.&lt;/p&gt;
&lt;h2 id="samesite"&gt;SameSite
&lt;/h2&gt;&lt;p&gt;Strict: máxima protección CSRF. Lax: balance seguridad/usabilidad. None + Secure: cookies de terceros (menos seguro).&lt;/p&gt;</description></item></channel></rss>