<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kevin Web</title>
    <description>The latest articles on DEV Community by Kevin Web (@stardothosting).</description>
    <link>https://dev.to/stardothosting</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3673885%2F76aa4bc0-dbd9-418e-858b-9679a202bb82.jpeg</url>
      <title>DEV Community: Kevin Web</title>
      <link>https://dev.to/stardothosting</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stardothosting"/>
    <language>en</language>
    <item>
      <title>Why auto_prepend_file and On-Server WordPress Firewalls Cause TTFB Lag</title>
      <dc:creator>Kevin Web</dc:creator>
      <pubDate>Fri, 02 Oct 2026 01:20:32 +0000</pubDate>
      <link>https://dev.to/stardothosting/why-autoprependfile-and-on-server-wordpress-firewalls-cause-ttfb-lag-njh</link>
      <guid>https://dev.to/stardothosting/why-autoprependfile-and-on-server-wordpress-firewalls-cause-ttfb-lag-njh</guid>
      <description>&lt;p&gt;When scaling WordPress sites, one of the most common bottlenecks developers overlook is the architectural placement of their Web Application Firewall (WAF).&lt;/p&gt;

&lt;h3&gt;
  
  
  The Pre-WordPress Execution Trap
&lt;/h3&gt;

&lt;p&gt;Most security plugins (like Wordfence) rely on PHP's &lt;code&gt;auto_prepend_file&lt;/code&gt; directive in &lt;code&gt;.htaccess&lt;/code&gt; or &lt;code&gt;.user.ini&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;[PHP Start] → [autoprependfile: wordfence-waf.php] → [Rule evaluation]&lt;/p&gt;

&lt;p&gt;→ [wp-config.php] → [WordPress Core] → [Plugins/Theme] → [HTML Output]&lt;/p&gt;

&lt;p&gt;This means &lt;strong&gt;before a single byte of HTML is rendered&lt;/strong&gt;, PHP must:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize the WAF engine in memory.&lt;/li&gt;
&lt;li&gt;Evaluate hundreds of regex patterns against the raw URI, POST body, and headers.&lt;/li&gt;
&lt;li&gt;Execute database reads/writes on &lt;code&gt;wp_wfHits&lt;/code&gt; and &lt;code&gt;wp_wflogs&lt;/code&gt; to track rate limits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On high-concurrency sites or WooCommerce checkout endpoints (&lt;code&gt;/?wc-ajax=checkout&lt;/code&gt;), this adds &lt;strong&gt;100ms–200ms+ of pure Time to First Byte (TTFB) delay&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving WAF Inspection to the Edge
&lt;/h3&gt;

&lt;p&gt;By contrast, an edge-based architecture filters Layer 7 attacks at the network boundary (using Coraza or ModSecurity engines) before requests ever hit PHP-FPM or MySQL.&lt;/p&gt;

&lt;p&gt;For a complete breakdown of benchmarks, database table status checks (&lt;code&gt;SHOW TABLE STATUS LIKE 'wp_wf%'&lt;/code&gt;), and cURL TTFB testing, read our full guide on &lt;a href="https://atomicedge.io/is-wordfence-slowing-down-your-site-a-technical-guide-to-fixing-ttfb-core-web-vitals-and-security/" rel="noopener noreferrer"&gt;how Wordfence affects TTFB and Core Web Vitals&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also check out our standalone open-source validation tool: &lt;a href="https://github.com/stardothosting/coraza-rule-validator" rel="noopener noreferrer"&gt;coraza-rule-validator on GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>wordpress</category>
      <category>performance</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
