diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 12801b1fc8..00f54c0abf 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -85,6 +85,7 @@
- [Change] Validate birthdays (Bug #15004)
+ - [Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)
1.i. Changes since 3.0.RC8
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index c3ba3820f9..9bf16ce0dc 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -68,6 +68,14 @@ if (isset($_GET['avatar']))
if ($last_load !== false && $last_load <= $stamp)
{
header('Not Modified', true, 304);
+ if (@php_sapi_name() == 'CGI')
+ {
+ header('Status: 304 Not Modified', true, 304);
+ }
+ else
+ {
+ header('HTTP/1.0 304 Not Modified', true, 304);
+ }
// seems that we need those too ... browsers
header('Pragma: public');
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));