diff options
author | friendica <info@friendica.com> | 2014-12-27 18:19:51 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-12-27 18:19:51 -0800 |
commit | 50943f439cb755c052507b8b459740a0ded193c2 (patch) | |
tree | 42f8e8e3e89fd99aecf659505080d627e627a241 /mod | |
parent | 096956ff78db02f9cfe8a185ca53a4d775effddb (diff) | |
download | volse-hubzilla-50943f439cb755c052507b8b459740a0ded193c2.tar.gz volse-hubzilla-50943f439cb755c052507b8b459740a0ded193c2.tar.bz2 volse-hubzilla-50943f439cb755c052507b8b459740a0ded193c2.zip |
issue #777, make photo cache time configurable, read the comments.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 3 | ||||
-rw-r--r-- | mod/photo.php | 18 |
2 files changed, 17 insertions, 4 deletions
diff --git a/mod/item.php b/mod/item.php index 9ffcc7de2..f5a9a4b22 100644 --- a/mod/item.php +++ b/mod/item.php @@ -683,7 +683,8 @@ function item_post(&$a) { } } - $item_flags |= ITEM_UNSEEN; + if(local_user() != $profile_uid) + $item_flags |= ITEM_UNSEEN; if($post_type === 'wall' || $post_type === 'wall-comment') $item_flags = $item_flags | ITEM_WALL; diff --git a/mod/photo.php b/mod/photo.php index 8cb82e8ff..66280cb76 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -224,9 +224,21 @@ function photo_init(&$a) { } else { - - header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT"); - header("Cache-Control: max-age=" . (3600*24)); + // 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. + + $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; |