Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
How can I customize my HTTP Headers?
Old 03-23-2010, 07:48 PM How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
Hi,

I am designing a website and learning everything as I go. I host with justhost.com, and create html docs which I upload onto the server. My website is updated regularly, and I want to be able to control the cacheing. I have found many websites that talk about HTTP Headers and how to use them to control cacheing, but I haven't found anything that explains how to actually make or change the HTTP Headers on my site in language that I can understand. I would greatly appreciate any insight.

Thank you, Layla
layla9 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2010, 07:59 PM Re: How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
If I need to post this in a different forum, please let me know.
layla9 is offline
Reply With Quote
View Public Profile
 
Old 03-23-2010, 08:00 PM Re: How can I customize my HTTP Headers?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
With HTML your only choice is using meta elements.

The http-equiv is the attribute to set which header you are using.

So for cacheing :

HTML Code:
<meta http-equiv="Cache-control" content="value">
and the possible values are:
  • Public - may be cached in public shared caches
  • Private - may only be cached in private cache
  • no-Cache - may not be cached
  • no-Store - may be cached but not archived
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-23-2010, 08:05 PM Re: How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
Right now I am using the following meta tags:

<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">

They are not doing the job adequately, and I have read in several places that meta tags are not reliable for controlling cacheing.

Will the tag you suggested work any differently or better than the ones I am already using?

Are there any other ways besides with HTML that I can use to modify the actual HTTP Headers?

Thank you.
layla9 is offline
Reply With Quote
View Public Profile
 
Old 03-24-2010, 02:39 PM Re: How can I customize my HTTP Headers?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The cache control headers are NOT intended for controlling browsers or search engines. Their use is for controlling the caching of proxy servers.


HTTP headers can be manipulated directly on the server, if you have access or server side code can be used to send HTTP headers and responses.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-24-2010, 04:31 PM Re: How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
I don't know if I have access to the server, or if I do I don't know how I would go about doing so.

Can you give me an idea of how I might access my server to adjust the HTTP Headers.

Thanks again.
layla9 is offline
Reply With Quote
View Public Profile
 
Old 03-24-2010, 06:04 PM Re: How can I customize my HTTP Headers?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Given that you are with one of the mass resellers I think we can say pretty conclusively that your chances of being granted such access is somewhere between zero and none.

It is also unlikely that you have a server side code to work with, so metas and http-equiv is probably your limit.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-31-2010, 12:31 AM Re: How can I customize my HTTP Headers?
Average Talker

Posts: 26
Name: Chris
Trades: 0
If you are thinking from the point of view of SEO then H1 tag is the better and you can definitely go with it.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
chris.klinton is offline
Reply With Quote
View Public Profile
 
Old 03-31-2010, 05:10 PM Re: How can I customize my HTTP Headers?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by chris.klinton View Post
If you are thinking from the point of view of SEO then H1 tag is the better and you can definitely go with it.
Hn elements are HEADINGS NOT headers!!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-31-2010, 05:27 PM Re: How can I customize my HTTP Headers?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Hn elements are HEADINGS NOT headers!!
Off with the head(er|ing) !
;D
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-01-2010, 04:08 PM Re: How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
I am not thinking in SEO. I recently found out how to control HTTP Headers in the .htaccess file on my server. I added some cache-control headers and at first it seemed to force a refresh when there had been a change, but then, just today, I made small changes on three different pages, and two of them refreshed and one didn't. The header control I used is:

Code:
# cache images for 3 month
<FilesMatch ".(gif|jpg|jpeg|png|flv|swf|ico)$">
Header set Cache-Control "max-age=7257600, must-revalidate"
</FilesMatch>

# cache everything else for 1 week
<FilesMatch ".(js|css|pdf|txt|html|htm)$">
Header set Cache-Control "max-age=604800, must-revalidate"
</FilesMatch>

# disable caching for dynamic files
<FilesMatch ".(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
Why didn't this work? What could I change to make it force a refresh when there have been changes, but allow it to use the cache if there haven't been changes?

Thanks

Last edited by layla9; 04-01-2010 at 04:10 PM.. Reason: typo
layla9 is offline
Reply With Quote
View Public Profile
 
Old 04-01-2010, 06:03 PM Re: How can I customize my HTTP Headers?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Could you provide a page where those headers should be set ?
I want to inspect them with a header sniffer, because you can have some things that interfere with them.
Namely: ETags.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-01-2010, 06:07 PM Re: How can I customize my HTTP Headers?
Novice Talker

Posts: 13
Name: Layla Stone
Location: California
Trades: 0
Quote:
Could you provide a page where those headers should be set ?
I want to inspect them with a header sniffer, because you can have some things that interfere with them.
Namely: ETags.
This is the header response on one of the pages on my site:

Status: HTTP/1.1 200 OK
Date: Thu, 01 Apr 2010 22:05:52 GMT
Server: Apache
Last-Modified: Thu, 01 Apr 2010 19:30:22 GMT
Accept-Ranges: bytes
Content-Length: 22203
Cache-Control: max-age=604800, must-revalidate
Connection: close
Content-Type: text/html
layla9 is offline
Reply With Quote
View Public Profile
 
Old 04-02-2010, 08:06 AM Re: How can I customize my HTTP Headers?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
604800 = 1 week in seconds
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How can I customize my HTTP Headers?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.16866 seconds with 12 queries