Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Please help me understand a few things found in the SO page source

Tags:

I was just viewing stackoverflow page source and I have a few simple questions;

1) What is the purpose of this? DO search engines see this or something else?

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">  

2) ?v=3731 Why is this added to the end of some javascript and stylesheet files, is it to prevent the browser from caching these items? And if I am correct, then why would you not want this, I would think they wouldn't change often

<script type="text/javascript" src="/content/js/master.js?v=3731"></script> 

3) What kind of file is this rel="canonical"

<link rel="canonical" href="http://stackoverflow.com/questions/1180651/php-array-and-foreach"> 

4) What is this, my guess is maybe if you put in the page URL into something like google reader it would find this file maybe?

<link rel="alternate" type="application/atom+xml" title="Feed for question 'php array and `foreach?'" href="/feeds/question/1180651">`  
like image 325
JasonDavis Avatar asked Jul 25 '09 02:07

JasonDavis


People also ask

What can you find in a page source?

When you are viewing the 'page source' you are just looking at the code used to create the visual website that you normally see. The information there explains things like what color the border above the logo should be, to what size a picture is displayed, to what information should be pushed to search engines.

What is the meaning of page source?

Also known as "source" and "document source," it is the HTML code (source code) of a Web page (HTML document).

Where do I find page source?

View Source Using View Page SourceRight-click the page and click on “View Page Source,” or press Ctrl + U, to see the page's source in a new tab.


1 Answers

  1. This is to enable a site to be used as a built in search within a browser. Similar to the way wikipedia can be used from the top right search bar in firefox. More info can be found here

  2. This is to make use of browser caching, which is likely to be aggressively set with the content headers. By appending v=?, it ensures that the latest js file is used when a revision is made.

  3. Canonical is used to specify the preferred version of a url, if that content is duplicated elsewhere.

  4. Yes this is used to indicate that the url can serve an rss/atom feed that can be fed through a reader such as google reader.

like image 184
Aurelio Tinio Avatar answered Sep 21 '22 01:09

Aurelio Tinio