![]() |
Strange problem with browser cache - 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: Strange problem with browser cache (/showthread.php?tid=32442) |
Strange problem with browser cache - El Forum - 07-23-2010 [eluser]earlyriser[/eluser] Hello I have this fonction in the 'Welcome' controller Code: function test() ONLINE: When I load the page it shows the current unix time. If I reload the page it doesn't get updated. I need to press CTRL F5. ON LOCALHOST The page is refreshed in every reload (without ctrl F5). Is that normal? That happens in Chrome, Firefox and IE. BUT if I autoload the session library, it get refreshed everytime online and on the localhost. Well I don't know actually if that's a problem, but I would like just to understand why this is happening in this way. Thanks. Strange problem with browser cache - El Forum - 07-23-2010 [eluser]mddd[/eluser] Some browsers will load the page out of cache if they think it is the same page. But when is it "the same page"? Some people use tricks like loading mypage.php?123456. If you change the number every time, the browser will think it is a different page even when it is the same. Likewise, if information in a cookie changes (like the session library uses), that too can be a reason for the browser to try and reload the page. As to why the caching happens only in the online version: maybe the browser is programmed to always reload local files. After all the main reason for caching is to increase speed and local files are usually already very fast to load. |