mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:15:13 +00:00
issue #777, make photo cache time configurable, read the comments.
This commit is contained in:
parent
096956ff78
commit
50943f439c
2 changed files with 16 additions and 3 deletions
|
@ -683,6 +683,7 @@ function item_post(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
if(local_user() != $profile_uid)
|
||||
$item_flags |= ITEM_UNSEEN;
|
||||
|
||||
if($post_type === 'wall' || $post_type === 'wall-comment')
|
||||
|
|
|
@ -224,9 +224,21 @@ function photo_init(&$a) {
|
|||
|
||||
}
|
||||
else {
|
||||
// The photo cache default is 1 day to provide a privacy trade-off,
|
||||
// as somebody reducing photo permissions on a photo that is already
|
||||
// "in the wild" won't be able to stop the photo from being viewed
|
||||
// for this amount amount of time once it is in the browser cache.
|
||||
// The privacy expectations of your site members and their perception
|
||||
// of privacy where it affects the entire project may be affected.
|
||||
// This has performance considerations but we highly recommend you
|
||||
// leave it alone.
|
||||
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT");
|
||||
header("Cache-Control: max-age=" . (3600*24));
|
||||
$cache = get_config('system','photo_cache_time');
|
||||
if(! $cache)
|
||||
$cache = (3600 * 24); // 1 day
|
||||
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache) . " GMT");
|
||||
header("Cache-Control: max-age=" . $cache);
|
||||
|
||||
}
|
||||
echo $data;
|
||||
|
|
Loading…
Reference in a new issue