Development

Changeset 4558

You must first sign up to be able to contribute.

Changeset 4558

Show
Ignore:
Timestamp:
07/08/07 17:33:19 (1 year ago)
Author:
fabien
Message:

added Last-Modified and ETag support for sfBrowser

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/util/sfBrowser.class.php

    r4447 r4558  
    200200    } 
    201201 
     202    // support for the ETag header 
     203    if ($etag = $this->context->getResponse()->getHttpHeader('Etag')) 
     204    { 
     205      $this->vars['HTTP_IF_NONE_MATCH'] = $etag; 
     206    } 
     207    else 
     208    { 
     209      unset($this->vars['HTTP_IF_NONE_MATCH']); 
     210    } 
     211 
     212    // support for the last modified header 
     213    if ($lastModified = $this->context->getResponse()->getHttpHeader('Last-Modified')) 
     214    { 
     215      $this->vars['HTTP_IF_MODIFIED_SINCE'] = $lastModified; 
     216    } 
     217    else 
     218    { 
     219      unset($this->vars['HTTP_IF_MODIFIED_SINCE']); 
     220    } 
     221 
    202222    // for HTML/XML content, create a DOM and sfDomCssSelector objects for the response content 
    203223    if (preg_match('/(x|ht)ml/i', $response->getContentType()))