PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Sun Aug 23, 2015 8:05 pm
2 items for the header, not sure which should be first or does it matter?
Code: Select all
<?php
Header("Cache-Control: must-revalidate");
$offset = 60 * 60 * 24 * 7;
$ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
Header($ExpStr);
?>
<!-- ETag allows a search engine the ability to identify page changes easily -->
<?php header("ETag: " . sha1(date("YmdHis", getlastmod()))); ?>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Celauran
Moderator
Posts: 6427 Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada
Post
by Celauran » Sun Aug 23, 2015 9:29 pm
Doesn't matter in the slightest
W3C wrote: The order in which header fields with differing field names are received is not significant. However, it is "good practice" to send general-header fields first, followed by request-header or response- header fields, and ending with the entity-header fields.
http://www.w3.org/Protocols/rfc2616/rfc ... tml#sec4.2
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Mon Aug 24, 2015 8:22 am
I have been considering more ideas for search engines and general site improvements
I have one other header so I guess they can be piled as needed
Code: Select all
<?php header('Content-Type: text/html; charset=ISO-8859-1'); ?>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Celauran
Moderator
Posts: 6427 Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada
Post
by Celauran » Mon Aug 24, 2015 8:58 am
[text]charset=ISO-8859-1[/text]
Oh, don't do that.
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Mon Aug 24, 2015 6:00 pm
unfortunately I need that due to some generated content
if I could I would use utf-8
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP