{"id":48,"date":"2010-09-07T11:05:33","date_gmt":"2010-09-07T17:05:33","guid":{"rendered":"http:\/\/www.p14nd4.com\/blog\/?p=48"},"modified":"2025-11-17T13:57:30","modified_gmt":"2025-11-17T19:57:30","slug":"wordpress-vbulletin-bridge-vbridge-disabling-wp-super-cache","status":"publish","type":"post","link":"https:\/\/www.p14nd4.com\/blog\/2010\/09\/07\/wordpress-vbulletin-bridge-vbridge-disabling-wp-super-cache\/","title":{"rendered":"WordPress vBulletin Bridge (vbridge) disabling WP Super Cache"},"content":{"rendered":"\n<p>As mentioned in my <a href=\"\/blog\/2010\/08\/17\/wordpress-vbulletin-bridge-nextgen-gallery-error\/\">previous post<\/a>, I&#8217;ve been playing with <a href=\"http:\/\/wordpress.org\/\">WordPress<\/a>, <a href=\"http:\/\/www.vbulletin.com\/\">vBulletin<\/a>, <a href=\"http:\/\/www.vbulletin.org\/forum\/showthread.php?t=205388\">vBridge<\/a>, and some other stuff as part of my work for my other site, <a href=\"http:\/\/www.TechwareLabs.com\/\">TechwareLabs<\/a>. One of the other plugins I utilize on that site is <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-super-cache\/\" rel=\"external\">WP Super Cache<\/a>, which I discovered was an easier way to accomplish basic static caching instead of trying to jump into the deep end of learning mod_cache, memcache, and other sorts of fancy things for an actual <a href=\"http:\/\/arstechnica.com\/civis\/viewtopic.php?f=8&amp;t=1109138\">elegant solution<\/a>.<\/p>\n\n\n\n<p>Unfortunately, these are complicated systems, and vbridge in particular seems slightly less polished than some more widely utilized components (though, in fairness, its user base is considerably smaller than most wordpress plugins).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>It was actually in the course of trying to track down the issue of why the TechBargains <q>Hot Deals Widget<\/q> is such an obnoxious memory hog (full disclosure: it may just be the final straw that&#8217;s breaking the camel&#8217;s back, but it does legitimately seem to be a pretty damn big piece straw) that I discovered WP SuperCache wasn&#8217;t doing its thing any more. After a little initial troubleshooting of my own, I acted on a hunch, and googled wordpress vbridge supercache, and was fortunate enough to immediately find a <a href=\"http:\/\/wordpress.org\/support\/topic\/plugin-wp-super-cache-0-cached-pages\/page\/2#post-1287646\">pertinent result<\/a>.<\/p>\n\n\n\n<p>As <a href=\"http:\/\/wordpress.org\/support\/profile\/nasium\">nasium<\/a> was kind enough to share, the <q>Complete Vbridge Plugin<\/q> apparently adds a variable <code>ajax<\/code> to the PHP <code>$_POST<\/code> variable, which WP Supercache&#8217;s criteria flags as reason not to cache. I wasn&#8217;t entirely convinced his solution of entirely removing these lines from <code>wp-content\/plugins\/wp-super-cache\/wp-cache-phase2.php<\/code> was appropriate:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">PHP<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>if ( $_SERVER&#91;\"REQUEST_METHOD\"&#93; == 'POST' || !empty( $_POST ) || get_option( 'gzipcompression' ) ) {\n    if ( isset( $GLOBALS&#91; 'wp_super_cache_debug' &#93; ) &amp;&amp; $GLOBALS&#91; 'wp_super_cache_debug' &#93; ) wp_cache_debug( 'Not caching POST request.', 5 );\n    return false;\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> ( <\/span><span style=\"color: #9CDCFE\">$_SERVER<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;REQUEST_METHOD&quot;<\/span><span style=\"color: #D4D4D4\">&#93; == <\/span><span style=\"color: #CE9178\">&#39;POST&#39;<\/span><span style=\"color: #D4D4D4\"> || !<\/span><span style=\"color: #DCDCAA\">empty<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #9CDCFE\">$_POST<\/span><span style=\"color: #D4D4D4\"> ) || <\/span><span style=\"color: #DCDCAA\">get_option<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #CE9178\">&#39;gzipcompression&#39;<\/span><span style=\"color: #D4D4D4\"> ) ) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> ( <\/span><span style=\"color: #DCDCAA\">isset<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #9CDCFE\">$GLOBALS<\/span><span style=\"color: #D4D4D4\">&#91; <\/span><span style=\"color: #CE9178\">&#39;wp_super_cache_debug&#39;<\/span><span style=\"color: #D4D4D4\"> &#93; ) &amp;&amp; <\/span><span style=\"color: #9CDCFE\">$GLOBALS<\/span><span style=\"color: #D4D4D4\">&#91; <\/span><span style=\"color: #CE9178\">&#39;wp_super_cache_debug&#39;<\/span><span style=\"color: #D4D4D4\"> &#93; ) <\/span><span style=\"color: #DCDCAA\">wp_cache_debug<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #CE9178\">&#39;Not caching POST request.&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">5<\/span><span style=\"color: #D4D4D4\"> );<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">false<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>&#8230;because they were probably there for a reason. I took a slightly less heavy-handed approach, and just added what I hope is a specific exclusion for this vbridge behavior:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">PHP<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>if ( $_SERVER&#91;\"REQUEST_METHOD\"&#93; == 'POST' || (!empty( $_POST ) &amp;&amp; (sizeof($_POST) > 1 || !array_key_exists('ajax', $_POST))) || get_option( 'gzipcompression' ) ) {\n    if ( isset( $GLOBALS&#91; 'wp_super_cache_debug' &#93; ) &amp;&amp; $GLOBALS&#91; 'wp_super_cache_debug' &#93; ) wp_cache_debug( 'Not caching POST request.', 5 );\n    return false;\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> ( <\/span><span style=\"color: #9CDCFE\">$_SERVER<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #CE9178\">&quot;REQUEST_METHOD&quot;<\/span><span style=\"color: #D4D4D4\">&#93; == <\/span><span style=\"color: #CE9178\">&#39;POST&#39;<\/span><span style=\"color: #D4D4D4\"> || (!<\/span><span style=\"color: #DCDCAA\">empty<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #9CDCFE\">$_POST<\/span><span style=\"color: #D4D4D4\"> ) &amp;&amp; (<\/span><span style=\"color: #DCDCAA\">sizeof<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$_POST<\/span><span style=\"color: #D4D4D4\">) &gt; <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> || !<\/span><span style=\"color: #DCDCAA\">array_key_exists<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&#39;ajax&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">$_POST<\/span><span style=\"color: #D4D4D4\">))) || <\/span><span style=\"color: #DCDCAA\">get_option<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #CE9178\">&#39;gzipcompression&#39;<\/span><span style=\"color: #D4D4D4\"> ) ) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> ( <\/span><span style=\"color: #DCDCAA\">isset<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #9CDCFE\">$GLOBALS<\/span><span style=\"color: #D4D4D4\">&#91; <\/span><span style=\"color: #CE9178\">&#39;wp_super_cache_debug&#39;<\/span><span style=\"color: #D4D4D4\"> &#93; ) &amp;&amp; <\/span><span style=\"color: #9CDCFE\">$GLOBALS<\/span><span style=\"color: #D4D4D4\">&#91; <\/span><span style=\"color: #CE9178\">&#39;wp_super_cache_debug&#39;<\/span><span style=\"color: #D4D4D4\"> &#93; ) <\/span><span style=\"color: #DCDCAA\">wp_cache_debug<\/span><span style=\"color: #D4D4D4\">( <\/span><span style=\"color: #CE9178\">&#39;Not caching POST request.&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">5<\/span><span style=\"color: #D4D4D4\"> );<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">false<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As such, when the <code>$_POST<\/code> variable contains more data than just the one <code>ajax<\/code> variable, or contains <em>just<\/em> an element that isn&#8217;t <code>ajax<\/code>, then WP Supercache will still abort, as its authors originally intended to do with any <code>$_POST<\/code> data. (Since I don&#8217;t know the full implications or reason behind why it was coded that way to begin with, I&#8217;m operating under the assumption that it&#8217;s important&#8211;I can see how it would be.)<\/p>\n\n\n\n<p><em>2010-10-10 Edit:<\/em> When I originally made this change on WordPress 2.8.5 and a slightly earlier version of WP Super Cache, I&#8217;d used <code>!isset($_POST['ajax'])<\/code>, and that worked, but after upgrading to WP 3.0.1 and the latest WP Super Cache (as of today, 2010-10-10), I had to change it to <code>!array_key_exists('ajax', $_POST)<\/code>. I didn&#8217;t upgrade my PHP version, so I&#8217;m not sure why this would&#8217;ve changed, but whatever&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Side Notes<\/h3>\n\n\n\n<p>While on the hunt, I finally re-found a little web page that gives some useful stats about web page load time, which caters at least slightly to wordpress blogs: <a href=\"http:\/\/ismyblogworking.com\/\">IsMyBlogWorking.com<\/a>. There are plenty of other sites out there that give more\/different information, which are also useful, but I like the quick high-level overview here (and it specifically notes when WP Supercache is active).<\/p>\n\n\n\n<p>I also found a reference to a reason <a href=\"http:\/\/ocaoimh.ie\/remove-unused-utmsource-urls\/#comment-672813\">WP Supercache might not work with google feedburner links<\/a>. I added the javascript call, which is easy enough, but still need to figure out actually changing &#8216;?&#8217; to &#8216;#&#8217; for incoming links. Anyone know about this?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After running into a problem with the Wordpress\/vBulletin bridge (vbridge) plugin disabling the WP Super Cache plugin, I found \/ improved a solution requiring very minimal modification.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[13,11,14],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-technical","category-techwarelabs","tag-vbridge","tag-wordpress","tag-wp-super-cache"],"_links":{"self":[{"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":2,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.p14nd4.com\/blog\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}