You can only currently disable the cache for an entity type.<div><br></div><div>See <a href="http://api.drupal.org/api/drupal/modules--field--field.attach.inc/function/field_attach_load/7">http://api.drupal.org/api/drupal/modules--field--field.attach.inc/function/field_attach_load/7</a>:</div>

<div><br></div><div><meta charset="utf-8"><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: &#39;Lucida Grande&#39;, &#39;DejaVu Sans&#39;, &#39;Bitstream Vera Sans&#39;, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px; "><pre class="php" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; ">

<code style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; background-position: initial initial; background-repeat: initial initial; "><span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$info</span> = <span class="php-function-or-constant" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(0, 0, 170); background-position: initial initial; background-repeat: initial initial; "><a href="http://api.drupal.org/api/drupal/includes--common.inc/function/entity_get_info/7" title="Get the entity info array of an entity type." class="local" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(0, 0, 170); text-decoration: none; font-weight: bold; background-position: initial initial; background-repeat: initial initial; ">entity_get_info</a></span>(<span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$entity_type</span>);</code></pre>

<pre class="php" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; ">

<code style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; background-position: initial initial; background-repeat: initial initial; "><meta charset="utf-8"><span class="Apple-style-span" style="font-family: &#39;Lucida Grande&#39;, &#39;DejaVu Sans&#39;, &#39;Bitstream Vera Sans&#39;, Verdana, Arial, sans-serif; font-size: 13px; white-space: normal; "><pre class="php" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; overflow-x: auto; overflow-y: auto; background-position: initial initial; background-repeat: initial initial; ">

<code style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(246, 246, 242); font-size: 0.923em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; vertical-align: baseline; font-family: &#39;Bitstream Vera Sans Mono&#39;, Monaco, &#39;Lucida Console&#39;, monospace; white-space: pre-wrap; background-position: initial initial; background-repeat: initial initial; "><span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$cache_read</span> = <span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$load_current</span> &amp;&amp; <span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$info</span>[<span class="php-string" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(170, 0, 0); background-position: initial initial; background-repeat: initial initial; ">&#39;field cache&#39;</span>] &amp;&amp; <span class="php-keyword" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(0, 102, 0); background-position: initial initial; background-repeat: initial initial; ">empty</span>(<span class="php-variable" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(51, 51, 0); background-position: initial initial; background-repeat: initial initial; ">$options</span>[<span class="php-string" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-size: 11px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; color: rgb(170, 0, 0); background-position: initial initial; background-repeat: initial initial; ">&#39;deleted&#39;</span>]);</code></pre>

</span></code></pre></span><div><br></div><div>Dave Reid<br><a href="mailto:dave@davereid.net">dave@davereid.net</a><br>
<br><br><div class="gmail_quote">On Sat, Jun 25, 2011 at 7:07 AM, Sven Decabooter <span dir="ltr">&lt;<a href="mailto:sdecabooter@gmail.com">sdecabooter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<div><br></div><div>Does anyone know if there&#39;s a way to avoid having fields cached in the database table cache_fields (Drupal 7)?</div><div>This would have to be enforced from within the module that defines the field, regardless of which entity the field is attached to..</div>



<div><br></div><div>After digging in the code I suppose it&#39;s just not possible, but if you have any pointers, let me know!</div><div>Sven</div>
</blockquote></div><br></div></div>