<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://embiggen.net"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>embiggen - dev</title>
 <link>https://embiggen.net/category/tags/dev</link>
 <description></description>
 <language>en</language>
<item>
 <title>How to keep Drupal from caching a page</title>
 <link>https://embiggen.net/post/how-keep-drupal-caching-page</link>
 <description>&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;I ran across a problem on a site today where some custom voting code had stopped working correctly.  Eventually, I figured out that the actual problem was due to the page being cached, so it wasn&#039;t showing the updated results.  I didn&#039;t want to turn off caching so, my next step was to figure out how to turn caching off for a particular page.  The Google found &lt;a href=&quot;http://drupal.org/project/cacheexclude&quot;&gt;CacheExclude&lt;/a&gt;, a module that allows you to do just that-- turn caching off for specific pages. &lt;/p&gt;
&lt;p&gt;That module did the job, but I wanted to know exactly how it worked.  Looking at the source, the &quot;magic&quot; was basically a single line:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$GLOBALS[&#039;conf&#039;][&#039;cache&#039;] = false;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In my case, the pages in question were created by custom code, so I just added that line to my code rather than adding another module. That will prevent Drupal from caching the page.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-above&quot;&gt;&lt;div class=&quot;field-label&quot;&gt;Tags:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;a href=&quot;/category/tags/drupal&quot;&gt;drupal&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;field-item odd&quot;&gt;&lt;a href=&quot;/category/tags/dev&quot;&gt;dev&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Mon, 18 Oct 2010 20:44:20 +0000</pubDate>
 <dc:creator>jrb</dc:creator>
 <guid isPermaLink="false">455 at https://embiggen.net</guid>
 <comments>https://embiggen.net/post/how-keep-drupal-caching-page#comments</comments>
</item>
</channel>
</rss>
