The page cache test fails (at least on SQLite) on my Ubuntu 9.04 installation, at the "Vary header is empty for authenticated users" assertion:

    $user = $this->drupalCreateUser();
    $this->drupalLogin($user);
    $this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar')));
    $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache'), t('Caching was bypassed.'));
    $this->assertFalse($this->drupalGetHeader('Vary'), t('Vary header was not sent.'));
    $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'no-cache, must-revalidate, post-check=0, pre-check=0', t('Cache-Control header was sent.'));
    $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', t('Expires header was sent.'));
    $this->assertEqual($this->drupalGetHeader('Foo'), 'bar', t('Custom header was sent.'));

Dumping $this->drupalGetHeaders(), I see a Vary: Accept-Encoding header, which seems to mean that the page was served from the cache.

CommentFileSizeAuthor
#3 deflate.patch1.3 KBmfb

Comments

c960657’s picture

Do you by any chance have zlib.output_compression or similar enabled? What other headers are sent?

mfb’s picture

I'm also seeing this test fail under MySQL on a default Ubuntu 9.04 configuration. The failure is at "Vary header was not sent." in bootstrap.test, line 174.

All tests pass if I remove /etc/apache2/mods-enabled/deflate.conf which contains:

<IfModule mod_deflate.c>
          AddOutputFilterByType DEFLATE text/html text/plain text/xml
</IfModule>

Sounds like we cannot assume the Vary header is not sent?

mfb’s picture

Title: Page cache test failing on SQLite? » Page cache test failing with mod_deflate
Status: Active » Needs review
StatusFileSize
new1.3 KB

This patch just checks that there is no Vary: Cookie header.

c960657’s picture

Status: Needs review » Reviewed & tested by the community

This looks good.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.