homepage Welcome to WebmasterWorld Guest from 50.19.206.49
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Previously Viewed: using php cookies and cached pages
The_Hat




msg:4188783
 7:11 pm on Aug 18, 2010 (gmt 0)

I built a dynamic website that shows dynamic lists based off of different criteria asked of the database. In order to use as few server resources as possible I cache each page above root and based on the age of that cache I either re-query the database or serve the cached file. I use the output buffer for this, starting it at the beginning of each page and writing the contents to the cache at the end.

Now I am wanting to use $_COOKIE to create a "recently viewed" list so that the user can easily go back to an item they viewed previously. But it occurred to me that if I check for a cookie and write the list onto the page that might be also written to the cached file and cause problems.. Is that the case? Would it be included in the output buffer?

I was thinking perhaps that maybe what I should do is use the page that would display the actual recent item list in an iframe on the page.. that way it wouldn't be included in the cache file, except for the fact that I would generate two different cached versions of each page. one with the iframe in the rendered page and one without.

Is there a better way to go about this?

 

The_Hat




msg:4188827
 8:25 pm on Aug 18, 2010 (gmt 0)

I think maybe I will just do all of that with javascript, keep it all client side.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved