imperium2335 Posted July 13, 2009 Share Posted July 13, 2009 Is there a way to cache the stuff get_file_contents gets so that after if I click the url to the site where the stuff in gfc came from, to open that url but much faster because it already fetched the data previously? I.e. is it possible to cache the data? Or is this a job for Curl? if so, could someone briefly explain how to do it? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/165771-fetching-webpage-content-and-caching/ Share on other sites More sharing options...
trq Posted July 13, 2009 Share Posted July 13, 2009 It would be easy enough to do, get whatever it is your getting with say.... file_get_contents('http://foo.com/bar/bob'), store it in a file at say.... local/foo.com/bar/bob then check your local directory structure before attempting any remote call. Link to comment https://forums.phpfreaks.com/topic/165771-fetching-webpage-content-and-caching/#findComment-874434 Share on other sites More sharing options...
imperium2335 Posted July 13, 2009 Author Share Posted July 13, 2009 so store it in the local settings/temp internet files place? Would I get the file name from the address bar? this could be problematic because some urls have loads of dynamic stuff behind them. Link to comment https://forums.phpfreaks.com/topic/165771-fetching-webpage-content-and-caching/#findComment-874437 Share on other sites More sharing options...
trq Posted July 13, 2009 Share Posted July 13, 2009 Actually, I might have misread your question. If your looking to help your browsers internet cache this approach won't work. I'm not sure what would. Link to comment https://forums.phpfreaks.com/topic/165771-fetching-webpage-content-and-caching/#findComment-874440 Share on other sites More sharing options...
imperium2335 Posted July 13, 2009 Author Share Posted July 13, 2009 Thanks anyway. Im trying to make some thing like this because I am in china and my own website in the uk is very fast and my connection to it from is good to. So what would be sweet is if i can use it to fetch the web documents for me and display to me, sorta like a browser in a browser with proxy if you get me. Link to comment https://forums.phpfreaks.com/topic/165771-fetching-webpage-content-and-caching/#findComment-874443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.