Answers.Body: <p>Craft makes no distinction whether it's caching for mobile, tablet, desktop, etc., so it'll need to be taken care of on the template end.</p>
  
  <p>You can easily do that with the "<a href="http://buildwithcraft.com/docs/templating/cache#using-key">using key</a>" parameter of the <a href="http://buildwithcraft.com/docs/templating/cache">{% cache %}</a> tag, though.</p>
  
  <pre><code>{% if craft.request.isMobileBrowser %}
      {% set cacheKeyType = 'mobile' %}
  {% else %}
      {% set cacheKeyType = 'desktop' %}
  {% endif %}
  
  {% cache using key "page-header-" ~ cacheKeyType %}
      ....
  {% endcache %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-06T00:28:30.843Z
Answers.LastActivityDate: 2014-10-06T00:28:30.843Z
Answers.UserDisplayName: Brad Bell
Body: <p>Are different cache saved for Mobile / Tablet / localisations or do we have to take care of this?</p>
  
  <p>I.e. if i use:</p>
  
  <pre><code>{% if craft.request.isMobileBrowser() %} 
  </code></pre>
  
  <p>will the response be cached for desktop users as well?</p>
  
Tags: <cache>
Title: Does the cache tag behave differently for Mobile vs Tablet vs Desktop?
ThreadText: # Does the cache tag behave differently for Mobile vs Tablet vs Desktop?
  
  (Asked by: username_0 on 2014-10-05)
  
  Are different cache saved for Mobile / Tablet / localisations or do we have to take care of this?
  
  I.e. if i use:
  
  ```
  {% if craft.request.isMobileBrowser() %} 
  
  ```
  
  will the response be cached for desktop users as well?
  
  **Tags:** cache
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-10-06. Score: 7 | Accepted answer
  
  Craft makes no distinction whether it's caching for mobile, tablet, desktop, etc., so it'll need to be taken care of on the template end.
  
  You can easily do that with the "[using key](http://buildwithcraft.com/docs/templating/cache#using-key)" parameter of the [{% cache %}](http://buildwithcraft.com/docs/templating/cache) tag, though.
  
  ```
  {% if craft.request.isMobileBrowser %}
      {% set cacheKeyType = 'mobile' %}
  {% else %}
      {% set cacheKeyType = 'desktop' %}
  {% endif %}
  
  {% cache using key "page-header-" ~ cacheKeyType %}
      ....
  {% endcache %}
  
  ```
  
  
  ---
  
  