DeanWhitehouse Posted May 18, 2009 Share Posted May 18, 2009 Is it possible to load a site (as in a page) into the browser cache. I want this so i can use ajax to load my site page then redirect the user there, like you can do with images. Any idea? Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/ Share on other sites More sharing options...
shlumph Posted May 18, 2009 Share Posted May 18, 2009 I'm not sure what you mean. Most browsers cache stylesheets, JS files, and images... but this isn't what you want... I'm not sure what you mean by using ajax to load your site page then redirect the user there... could you explain some more? Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836097 Share on other sites More sharing options...
DeanWhitehouse Posted May 18, 2009 Author Share Posted May 18, 2009 What my end plan is, is to be able to offer the user a way to preload most of the site before using the site, so they go to the preload page and it will load the sites images, and pages before display them. Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836101 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 How in the world would you do that? If that was possible then it would be possible to load all sorts of malware on people's computers. Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836102 Share on other sites More sharing options...
MadTechie Posted May 18, 2009 Share Posted May 18, 2009 google javascript pre-load image, you can use the same idea for CSS or JS but i hardly see a good the reason. Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836105 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 That won't be "before they use his site" though... Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836116 Share on other sites More sharing options...
MadTechie Posted May 18, 2009 Share Posted May 18, 2009 Very true, i had to assume he ment a main page that allowed to load the other pages before visiting them.. as i said i can't see any good reason for it, if i site is designed well then this approach is unneed and infact will be more wasteful for bandwidth and also slow down the whole sites loading. No disrespect intended! Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836120 Share on other sites More sharing options...
shlumph Posted May 18, 2009 Share Posted May 18, 2009 Ok - I'm not the only one who is confused as to why someone would want to do this. Props for thinking differently, though. Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-836132 Share on other sites More sharing options...
DeanWhitehouse Posted May 26, 2009 Author Share Posted May 26, 2009 I have half achieved this already, basically what i have it doing is when you log in it takes you to a loading page which will load all the main site images to improve loading time on the site. Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842525 Share on other sites More sharing options...
gevans Posted May 26, 2009 Share Posted May 26, 2009 Surely you want to get individual page load times down as you visit them without having a huge openning page load time as it is this original load time that will put people off your site. Sounds like a flash website without flash Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842528 Share on other sites More sharing options...
MadTechie Posted May 26, 2009 Share Posted May 26, 2009 The funny things is by the time the user has half download the main page and left thats the same as someone visting half your site, also this assumes people go to the main page first, who wants to goto a site and have to download everything ? personally if i was downloading a printer driver i want the driver for the model printer that runs on my OS, i don't want to download every driver ever made my that company "to save me time later" trying to speed up a bad design is more work than a re-design, Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842622 Share on other sites More sharing options...
redarrow Posted May 26, 2009 Share Posted May 26, 2009 why not re-size the images or convert them to a better format to speed things up? Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842628 Share on other sites More sharing options...
DeanWhitehouse Posted May 26, 2009 Author Share Posted May 26, 2009 Well i'm not the designer, and am trying to compensate for those with bad internet and also some pages (e.g. blackjack) which has lots of images (cards) which without preloading might not show in time for certain users (as the game can be quick) its just another way to optimise loading times, and i don't expect preloading the images to take that long Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842637 Share on other sites More sharing options...
Axeia Posted May 26, 2009 Share Posted May 26, 2009 Actually his idea isn't that bad, you'd simply let javascript add the stylesheets/javascript files to the current page. (With the expiration header set to the some point in the future ) and while the user is typing his/her username/password half the stuff off the next page resides in the cache. Simply add something like this to the bottom of the page. <script type="text/javascript"> var stylesheet document.createElement( 'style' ); stylesheet.rel = "stylesheet"; stylesheet.type = "text/css"; stylesheet.href = "/css/stylesheet.css"; document.body.appendChild( stylesheet ); </script> Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842648 Share on other sites More sharing options...
MadTechie Posted May 26, 2009 Share Posted May 26, 2009 Please note thats NOT what you asked, pre loading images is one thing and in somecases makes sense, you said Is it possible to load a site (as in a page) into the browser cache. I want this so i can use ajax to load my site page then redirect the user there, like you can do with images. Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-842731 Share on other sites More sharing options...
DeanWhitehouse Posted May 27, 2009 Author Share Posted May 27, 2009 And a site consists of images, stylesheets and javascript XD And yes one way i tried to do what i wanted was to use ajax to load the page, as that way the page is loaded into the browser cache and displayed when i want Quote Link to comment https://forums.phpfreaks.com/topic/158530-load-site-into-memory/#findComment-843385 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.