Page 1 of 1
Load .php pages in specified div area
Posted: Sun Apr 22, 2012 7:42 pm
by dyr
Hi! I'm building a layout for my website and in an effort to save loading time i'd like my header.php page and sidebar to not have to keep reloading when I travel to a new page. Is it possible to have new pages load within a set div? How would I go about this, without affecting the timeOut function (if a user is idle for 60 minutes it logs them out)?
Re: Load .php pages in specified div area
Posted: Mon Apr 23, 2012 1:39 pm
by califdon
Give us some idea of how much content is in your header and sidebar. Under typical conditions, the loading time of a header and sidebar is insignificant, compared to a 60 minute time-out. Unless you have an unusual amount of content, I would not attempt any special measures to avoid reloading, which might very likely increase the loading time.
Re: Load .php pages in specified div area
Posted: Mon Apr 23, 2012 4:55 pm
by pickle
+1. Unless you're doing some REALLY heavy lifting in the header or sidebar, I wouldn't bother trying to avoid loading them.
Re: Load .php pages in specified div area
Posted: Mon Apr 23, 2012 7:35 pm
by dyr
Alright, here's what the side-bar has: display name, their amount of money, inbox link (and if there are new messages), recent posts, and a little chatter box. I think the problem is our cbox plug-in is making the whole screen flash as they travel to different pages, so I suppose I could just code one myself with ajax and that could eliminate the problem, if the speed won't make that much difference I'll trust you and not worry about it!
Re: Load .php pages in specified div area
Posted: Mon Apr 23, 2012 9:16 pm
by califdon
That's a trivial amount of content. You may be right about the chat box, if it's a plugin there could be an issue. But my recommendation would be to just test it as it is, if you haven't already, and only change it if it produces a problem. If you find that there is noticeable delay or flashing, your approach of coding your own Ajax driven chat box sounds like a reasonable alternative. But I wouldn't assume that you have a problem prematurely.
Re: Load .php pages in specified div area
Posted: Tue Apr 24, 2012 9:43 am
by pickle
If you want to reduce the load, you could store most of that stuff in $_SESSION & only re-load it every 5 or 10 minutes. You could also make the chat opt-in.