Having a hard time finding documentation explaining in any depth how date caching works in Drupal 7. Adding a date field to a content type allows a checkbox option that says "Cache dates: Date objects can be created and cached as date fields are loaded, rather than when they are displayed, to improve performance." In what scenarios is it a good idea to select this option? How does it improve performance?

  • Welcome to Drupal Answers. If that link contained the information you needed, feel free to answer your own question here. Just post the relevant information using the answer form below. (Please do not post just the link, because links can break over time.) This way you will help others, or maybe even your future self, who come here with the same question. – marcvangend Dec 20 '17 at 21:39

Found this 5 year old comment in the issue thread that gives some more context. Not sure why the enhanced help text didn't make it into the 7.x module, but it helped me make the decision. https://www.drupal.org/project/date/issues/1358790#comment-6327490

In order to display a date, a date object is created. Creating and caching date objects at the time date field data is entered may improve performance. For single-value, non-repeating, date fields caching will be neutral or have a performance benefit. For multiple-value or repeating dates with a large number of values, caching may negatively impact performance as some date objects that are cached may never actually be required.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.