You are here

README.txt in Context Mobile Detect 7

Same filename and directory in other branches
  1. 7.2 README.txt
This module is really simple and allows to show certain blocks based on context.

It gets tricky when the drupal page cache is enabled.

In this case the following line needs to be added to the end of settings.php:

include DRUPAL_ROOT . '/sites/all/modules/custom/context_mobile_detect/settings.inc';

This will ensure that the page cache is prefixed correctly.

It gets a little more tricky -- if Varnish is used. The VCL rules need to be changed as follows:

* Disable caching for the current request if no "device" cookie was sent.
* Do not strip "device" cookie
* Vary cache based on cookie content (default).

The real trick is to not deliver from cache, if no device cookie was sent. Afterwards all requests will be cached.

Enjoy!

File

README.txt
View source
  1. This module is really simple and allows to show certain blocks based on context.
  2. It gets tricky when the drupal page cache is enabled.
  3. In this case the following line needs to be added to the end of settings.php:
  4. include DRUPAL_ROOT . '/sites/all/modules/custom/context_mobile_detect/settings.inc';
  5. This will ensure that the page cache is prefixed correctly.
  6. It gets a little more tricky -- if Varnish is used. The VCL rules need to be changed as follows:
  7. * Disable caching for the current request if no "device" cookie was sent.
  8. * Do not strip "device" cookie
  9. * Vary cache based on cookie content (default).
  10. The real trick is to not deliver from cache, if no device cookie was sent. Afterwards all requests will be cached.
  11. Enjoy!