Andrey Posudevsky
Andrey Posudevsky

Reputation: 117

How to exclude field from cache in drupal?

How can I exclude field from caching not excluding page from being cached? Field value is modified using _preprocess_field hook depending on cookie variable. Cache system caches the entire page and mymodule_preprocess_field never called to change the field value. Any ideas how to exclude this field from caching?

Upvotes: 0

Views: 272

Answers (1)

oknate
oknate

Reputation: 1148

Drupal page cache caches entire page. If you want a small part of data to update, such as user login or up to the date stock prices, you should use ajax, and on the page that's returning ajax set it to not cache.

Upvotes: 1

Related Questions