| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Core_Page_AJAX {
/**
- * Call generic ajax forms
+ * Call generic ajax forms.
*
*/
public static function run() {
}
/**
- * Change is_quick_config priceSet to complex
+ * Change is_quick_config priceSet to complex.
*
*/
public static function setIsQuickConfig() {
}
/**
- * Set headers appropriate for a js file
+ * Set headers appropriate for a js file.
+ *
+ * @param int|NULL $ttl
+ * Time-to-live (seconds).
*/
- public static function setJsHeaders() {
- // Encourage browsers to cache for a long time - 1 year
- $year = 60 * 60 * 24 * 364;
- header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $year));
+ public static function setJsHeaders($ttl = NULL) {
+ if ($ttl === NULL) {
+ // Encourage browsers to cache for a long time - 1 year
+ $ttl = 60 * 60 * 24 * 364;
+ }
+ header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $ttl));
header('Content-Type: application/javascript');
- header("Cache-Control: max-age=$year, public");
+ header("Cache-Control: max-age=$ttl, public");
}
/**
}
CRM_Utils_System::civiExit();
}
+
}