icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old September 14th, 2004, 3:07 AM   #1 (permalink)
Uniquely Me
Super #1
 
MrCoolDale's Avatar
 
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
keeping a page cached?

I need some help.
First, is it pronounced like cash or cashay? I hear it both ways and wasn't sure which was was correct, if either.

second. I need some code from ya'll. I need something to keep a page cached for a while, about an hour would be nice. I'm making a site that will have a lot of static content (header, footer, navigation, various images, etc.) and the rest is phpinclude().

I would prefer to have a shell for an index page. I want just index.html to have very little in the source, makes things easier on me. I would use phpinclude() or header() or whatever else for everything.

Any help here is much appreciated. If this is already a thread somewhere, feel free to yell at me, but I didn't see it. Thanks in advanced.

- Dale?
__________________
Server: Pass
Website: MrCoolDale.com
Current Project: As Of Yet - Uniquely Me
Co-Winner: 2004 Surpassies - Ultimate Surpasser

MrCoolDale is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 3:14 AM   #2 (permalink)
Web Hosting Super Ninj4
Super #1
 
miakeru's Avatar
 
Joined in Sep 2003
Lives in Fullerton, CA
1,581 posts
Gave thanks: 0
Thanked 2 times
http://dictionary.reference.com/search?q=cache&r=67

I don't think you can force a browser to cache a page, but only force it to not read from cache. It should happen automatically by the browser, unless your site tells it not to, or the user has disabled it.

I could be completely wrong, though. I spent a couple of minutes searching on Google, and found nothing on how to force a browser to cache a page.
miakeru is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 3:15 AM   #3 (permalink)
Marketing Maven
Surpass Staff
 
Kayla's Avatar
 
Joined in May 2003
Lives in Chicago
24,757 posts
Gave thanks: 946
Thanked 807 times
A hiding place used especially for storing provisions.

PROVISIONS.
Kayla is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 8:57 AM   #4 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
I use php include for a lot of stuff. My index.php looks something like this:
PHP Code:
<?php
require 'head.inc';
if (isset(
$_GET['class'])) {
$class="";    
}
if (!isset(
$_GET['page'])) {$content'page1.inc';}
else {
$content$_GET['page'].'.inc'$class="tc";}
include 
'containers.inc';


include 
$content;
include 
'footer.inc';
?>
The 'class' variable is passed with the ? in the url and sets the main page.

The page is designed with CSS and divs.

If you use CSS, and much of your graphic content is part of that css (backgrounds to divs, etc) then you'll see a lot of that get cached so that it won't have to be reloaded.

John
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 10:19 AM   #5 (permalink)
sam
Surpass Fan
Super #1
 
sam's Avatar
 
Joined in Dec 2003
Lives in NJ
5,057 posts
Gave thanks: 0
Thanked 4 times
Cache is a worthy foe.

Different browsers implement cache and provide for many possible configurations.

For instance - IE5-6 allows for settings that will force the browser to fetch for a new instance of the page contents on every visit to a site. Or it can be set to never. These settings work, sort of - because they can be overriden if you output the right magic headers for the browser.

As Gump says - "browser cache is like a box of chocolates. you never know what you gonna get. Jenn-ay! Come back to Greenboro!"
sam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 2:28 PM   #6 (permalink)
Uniquely Me
Super #1
 
MrCoolDale's Avatar
 
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
thanks everyone, I have another question for bigjohn.

John - how does that coding work? What kind of stuff would I need to change if I wanted to include a page called header.html? I'm still kind of new to php and don't really know what I'm looking at.

- Dale?
__________________
Server: Pass
Website: MrCoolDale.com
Current Project: As Of Yet - Uniquely Me
Co-Winner: 2004 Surpassies - Ultimate Surpasser

MrCoolDale is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 2:38 PM   #7 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
you can 'include' any filename. You just have to make sure that you don't include a </body> before proper content...

Here is a head.inc:
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd"
>
<
HTML>
<
head>
<
title>HOST-MY-SITE.COM Welcome!  Value web-hosting and Discount Domains!</title>
<
meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" >
<
link rel="stylesheet" type="text/css" href="css/menus.css" >
<
script language="javascript" src="popwin.js" type="text/javascript">
</script>
<script language="javascript" src="checkform.js" type="text/javascript">
</script>
<script language="javascript" src="scriptmailer.js" type="text/javascript">
</script>

</head> 
notice something? Not a tick of PHP code in there...
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 2:44 PM   #8 (permalink)
Uniquely Me
Super #1
 
MrCoolDale's Avatar
 
Joined in Nov 2003
Lives in Anywhere
Hosted on Pass
2,660 posts
Gave thanks: 0
Thanked 0 times
to tell you the truth bigjohn, I haven't the slightest idea what I'm looking at there. What exactly does that script do?

- Dale?
__________________
Server: Pass
Website: MrCoolDale.com
Current Project: As Of Yet - Uniquely Me
Co-Winner: 2004 Surpassies - Ultimate Surpasser

MrCoolDale is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 14th, 2004, 2:55 PM   #9 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
The scripts don't do anything.

If you look at the index.php you'll see 'require head.inc'

that means that every instance of the page will load that. Because PHP is server parsed, the first bit of content that is returned to the client browser is the content in the head.inc file. Note that it's completely the same as if I did that part of the page in HTML alone, right?

How I learned to do this is:

1 - think of the page that you'd want and how it would be built in HTML
2 - think of the logical ways to break it into pieces so that you can update the content.

then hack the parts into '.inc' files.

if content has to be dynamic inside, you can use variables too...
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On