You are here

public static function InstapageCmsPluginHelper::disableCaching in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/InstapageCmsPluginHelper.php \InstapageCmsPluginHelper::disableCaching()

Sets a proper headers to disable caching by browsers and CDNs.

1 call to InstapageCmsPluginHelper::disableCaching()
InstapageCmsPluginPageModel::display in core/models/InstapageCmsPluginPageModel.php
Displays the landing page.

File

core/InstapageCmsPluginHelper.php, line 494

Class

InstapageCmsPluginHelper
Helper containing commonly used static functions.

Code

public static function disableCaching() {
  if (!headers_sent()) {
    header('Cache-Control: no-cache, no-store, must-revalidate');
    header('Pragma: no-cache');
    header('Expires: 0');
    setcookie('no-cache', 'true');
  }
}