Body: <p>We are setting our Cache-Control headers in the layout file for all templates.  However some templates the Cache-Control is being overridden.  Why might this be?</p>
  
  <pre><code>{% set expiry = now|date_modify('+10 minutes') %}
  {% header "Cache-Control: max-age=" ~ (expiry.timestamp - now.timestamp) %}
  {% header "Pragma: cache" %}
  {% header "Expires: " ~ expiry|date('D, d M Y H:i:s', 'GMT') ~ " GMT" %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-29T19:46:54.747Z
Comments.Text: What kind of templates are that? And what are the cache-control set to?
Comments.UserDisplayName: André Elvan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-29T19:57:03.050Z
Comments.Text: We have our base layout template which is extended by all other templates. So the layout parent template sets the head cache control settings as shown above. No other templates are setting the Cache-Control header explicitly.
Comments.UserDisplayName: a-am
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-29T20:16:19.933Z
Comments.Text: Maybe a plugin is setting it? I'd isolate which pages you're seeing the behavior on, then start commenting out template code to narrow down where it's occurring.
Comments.UserDisplayName: Brad Bell
Tags: <cache>
Title: Set Cache-Control is being overridden
ThreadText: # Set Cache-Control is being overridden
  
  (Asked by: username_0 on 2015-07-29)
  
  We are setting our Cache-Control headers in the layout file for all templates. However some templates the Cache-Control is being overridden. Why might this be?
  
  ```
  {% set expiry = now|date_modify('+10 minutes') %}
  {% header "Cache-Control: max-age=" ~ (expiry.timestamp - now.timestamp) %}
  {% header "Pragma: cache" %}
  {% header "Expires: " ~ expiry|date('D, d M Y H:i:s', 'GMT') ~ " GMT" %}
  
  ```
  
  **Tags:** cache
  
  > **Comments:**
  > **username_1**: What kind of templates are that? And what are the cache-control set to?  
  > **username_0**: We have our base layout template which is extended by all other templates. So the layout parent template sets the head cache control settings as shown above. No other templates are setting the Cache-Control header explicitly.  
  > **username_2**: Maybe a plugin is setting it? I'd isolate which pages you're seeing the behavior on, then start commenting out template code to narrow down where it's occurring.  
  
  ---
  
  ## 0 answers
  
  