? 147310-94.patch
? sites/all/modules
? sites/default/files
? sites/default/settings.php
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.263
diff -r1.263 bootstrap.inc
723,726c723,740
<   header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
<   header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
<   header("Cache-Control: store, no-cache, must-revalidate");
<   header("Cache-Control: post-check=0, pre-check=0", FALSE);
---
>   // check if module_implements exists to avoid problems during installation
>   $send_uncacheable_headers = TRUE;
>   if(function_exists('module_implements') && module_implements('expires')) {
>     // pass TRUE to hook_expires because the user is logged in
>     $lifetime = min(module_invoke_all('expires', FALSE));
>     if($lifetime > 0) {
>       $send_uncacheable_headers = FALSE;
>       header("Expires: " . gmdate(DATE_RFC1123, REQUEST_TIME + $lifetime));
>       header('Cache-Control: public, max-age=' . $lifetime);
>     }
>   }
> 
>   if($send_uncacheable_headers) {
>     header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
>     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>     header("Cache-Control: store, no-cache, must-revalidate");
>     header("Cache-Control: post-check=0, pre-check=0", FALSE);
>   }
759,761c773,789
<   // The following headers force validation of cache:
<   header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
<   header("Cache-Control: must-revalidate");
---
>   // the following allows modules to specify their own cache expiration time
>   $send_uncacheable_headers = TRUE;
>   if(count(module_implements('expires')) > 0) {
>     $lifetime = min(module_invoke_all('expires', TRUE));
>     $age = abs(REQUEST_TIME - $cache->created);
>     if($lifetime - $age > 0) {
>       $send_uncacheable_headers = FALSE;
>       header("Expires: " . gmdate(DATE_RFC1123, $cache->created + $lifetime));
>       header('Cache-Control: public, max-age=' . max(0, $lifetime - $age)); 
>     }
>   }
> 
>   if($send_uncacheable_headers) {
>     // Use the old header which does not get cached
>     header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
>     header("Cache-Control: must-revalidate");
>   }
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.9
diff -r1.9 system.api.php
146a147,164
> /** 
>  * Suggest an expiration time to send to the client as the expires HTTP header
>  *
>  * Only use this hook if you need your pages to be cacheable by reverse proxies
>  * or CDNs. If multiple modules return a value for this function, the earliest
>  * timestamp is honored. The simplest implementation of this function would
>  * return the number of seconds to cache all pages. More advanced implementations
>  * could return a different value depending on the current page.
>  *
>  * @param $page_is_cached
>  *   Whether the response is from cache
>  * @return
>  *   Number of seconds before the current page expires.
>  */
> function hook_expires($page_is_cached) {
>   return 0;
> }
> 
