SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple http-equiv meta elements in the same index.htm file

    Could you have multiple http-equiv meta elements in one index.htm file, such as:

    Code:
    HTML Code:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
                <meta http-equiv="expires" content="Fri, 21 Aug 2009 00:15:00 GMT" />
    See what I am trying to do here is keep the charset the same, but also have search engines expire the current cache for this site as I have made many changes to my website. It is still under construction and I was wondering if this is the best way to "re-cache" the new content. Specifically, the title, description and keywords meta elements. Any assistance with this would be greatly appreciated.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Expires headers are for browser caches, not search engines. They update their cache based on the last time the crawler visited the page, not by HTTP headers.

  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply and your correction to a technicality in my post.

    However, this does not answer the question of whether or not I can have multiple http-equiv meta elements in my index.htm file.

    Anyone that may have this answer or reference to get an answer on this please post.

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can, as many as you need, but they have no effect most of the time. You should use real HTTP headers.

  5. #5
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    You can, as many as you need, but they have no effect most of the time. You should use real HTTP headers.
    Modern browsers tend to honor the pseudo headers. The key is that the server response headers trump document headers. This is good to know, as you can have the server not set the character encoding, and set it in the document's http-equiv, to allow for document content that does not match your own default. See http://www.w3.org/TR/html4/struct/global.html#h-7.4.4.

    Do keep in mind that IE ignores even server headers, preferring to sniff the file content. Experiment: Take an html document, change the extension to .txt, or nothing at all. The server should deliver that as text/plain. Modern browsers will render it as plain text. IE will render it as html (I haven't tested IE8).

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •