2

While loading stackoverflow.com ... waiting for sstatic.net

While loading vark.com ... waiting for static.varkimg.com

Is there some trend here?

When it says "static", what all elements of the site are being loaded?

1
  • 2
    @Sathya: Hey, calm down there brother! If my own http://superuser.com/questions/78408/how-does-http-to-work is valid, I don't see why this one is out-of-scope.
    – Phoshi
    Jun 8, 2010 at 20:23

5 Answers 5

1

"Static" in this case refers to elements on a web page that do not change.

There is overhead in requesting a new page on a web-site. For example this page's url:

http://superuser.com/questions/150261/what-are-the-static-elements-of-a-website

Refers specifically to this page and can be linked from other web-sites and it will serve up content specific to this page.

However, there tons of elements on this page that are the same. The logo on the page is the same, the structure on the page is the same (for the most part) and the javascript can be the same on the page.

Instead of completely generating a new page with every request, some of the elements on the page are assigned to a separate web-server to serve, thus freeing up CPU cycles for more users.

Apache uses a process called Server Side Includes to accomplish this. Many other web-platforms have other methods, but the method on there is fairly simple. To summarize from Apache's site:

What are SSI?

SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology.

The decision of when to use SSI, and when to have your page entirely generated by some program, is usually a matter of how much of the page is static, and how much needs to be recalculated every time the page is served. SSI is a great way to add small pieces of information, such as the current time. But if a majority of your page is being generated at the time that it is served, you need to look for some other solution.

2

The images, scripts and things like that that "doesn't change dynamically" ( hence static )

1

Anything that's the same on every page could be called static. This can often include javascript files, header/footer/layout stuff, and images - but it can vary depending on the site.

Using something like LiveHTTPHeaders you can see exactly what's loaded from where.

0

Any media resources - images, js, css, pdfs, etc.

0

Static content refers to elements on a web site that are static, or that do not change.

Website are constantly looking for ways of optimizing their servers. One thing they use is caching. Although the individual pages of a website are difficult to cache because they are different for each user and change over time, certain aspects of a website remain constant. Elements such as images, JavaScript files, CSS stylesheets, etc do not change often, and thus are good candidates for caching. Serving this "static" content from a special domain helps to cut down on additional overhead on the request since the usual site cookies will not be sent. In the end its all about optimizing the performance of the site. You can read a bit about how it works here on SuperUser and the other sites on the blog.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .