mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature #379, multiple format, no browser cache
No need random string in URL to avoid browser cache, coding tip by @modus75
This commit is contained in:
+1
-1
@@ -186,7 +186,7 @@ if (!url_is_remote($file))
|
|||||||
// HTTP/1.1 only
|
// HTTP/1.1 only
|
||||||
$http_headers[] = 'Cache-Control: private, must-revalidate, max-age='.$max_age;*/
|
$http_headers[] = 'Cache-Control: private, must-revalidate, max-age='.$max_age;*/
|
||||||
|
|
||||||
if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
|
if ('f' != $_GET['part'] and isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
|
||||||
{
|
{
|
||||||
set_status_header(304);
|
set_status_header(304);
|
||||||
foreach ($http_headers as $header)
|
foreach ($http_headers as $header)
|
||||||
|
|||||||
+1
-1
@@ -677,7 +677,7 @@ SELECT *
|
|||||||
foreach ($formats as &$format)
|
foreach ($formats as &$format)
|
||||||
{
|
{
|
||||||
$format['download_url'] = 'action.php?format='.$format['format_id'];
|
$format['download_url'] = 'action.php?format='.$format['format_id'];
|
||||||
$format['download_url'].= '&download='.substr(md5(time()), 0, 6); // a random string to avoid browser cache
|
$format['download_url'].= '&download';
|
||||||
|
|
||||||
$format['label'] = strtoupper($format['ext']);
|
$format['label'] = strtoupper($format['ext']);
|
||||||
$lang_key = 'format '.strtoupper($format['ext']);
|
$lang_key = 'format '.strtoupper($format['ext']);
|
||||||
|
|||||||
Reference in New Issue
Block a user