![]() |
Image Problem! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Image Problem! (/showthread.php?tid=13104) |
Image Problem! - El Forum - 11-11-2008 [eluser]Lazos[/eluser] Hi. Maybe this forum is not the right one for this question. I hope somebody will answer though. I have a script that resize and rotate images. I am using an iframe for viewing the images and I have small thumbnails for every image using the image manipulation class of CI. Below them I have small icons for rotating and resizing the image. Anyway when I rotate something and even I have the refresh or location redirect inside the iframe images do not change to their new state after rotation. I need to refresh the iframe manually in order to see the changes. Do you know how to fix this problem? (Is it because the browser is caching images and because even I rotate or resize I keep the same name browser still things is the same image?) I hope somebody can help me. Thanks. Image Problem! - El Forum - 11-11-2008 [eluser]Jelmer[/eluser] I had the same problem and the fix was pretty easy once I figured it out. Instead of using: Code: echo '<img src="path/to/your/image.jpg" alt="" />'; Use: Code: echo '<img src="path/to/your/image.jpg?'.time().'" alt="" />'; Even though it's the same image the ? and the number behind it make the browser consider it a new image. Image Problem! - El Forum - 11-11-2008 [eluser]narkaT[/eluser] additional you can send some headers to prevent caching: Code: Cache-Control: no-cache, must-revalidate so you can prevent that the cache of "whatever gets in contact with that request" (proxy's etc..) gets flooded with "new images" ![]() Image Problem! - El Forum - 11-11-2008 [eluser]Jelmer[/eluser] Thought about that, but for this instance I prefer this solution because it only reloads the image I want, and it gets the stylesheet and interface images without checking from the cache. It's just a little bit faster. |