The server resizes images in the background, so a trace is made to control the cache. crutch from redirects: .htaccess
RedirectMatch "^/images/uploaded/([0-9]+)/([^\.]+)\.(png|jpg|gif)$" /image_view.php?user_id=$1\&file=$2.$3
<?php if (isset($_GET['file']) && isset($_GET['user_id'])) { $path_to_image = 'images/uploaded/' . intval($_GET['user_id']) . '/' . $_GET['file']; $modified = filemtime($path_to_image); header('Location:' . $path_to_image . '?' . $modified, true, 303); }
As it is not difficult to guess, there is a looping, because php generates redirection along the same path, with the addition of the $ modified parameter, how to exclude this redirection from htaccess and take into account calls to (png | jpg | gif) without the "?"