I'm using jquery. I've attempted searching how you can implement them however it will not make any sense in my experience. It discusses apache and Django and Lighttpd, however i have no clue what individuals are.

I made use of ySlow on my small web page also it explained I want an expires header..

Apparently it truly aids in performance though and that is things i actually need. Anybody help?

It's nothing related to jQuery. Your server's response should set the right headers like Expires, E-Tag etc.

What language are you currently using around the server side?

If you are using PHP, a good example of delivering the Expires header could be:

header("Expires: Tue, 31 Aug 2010 02:30:00 GMT");

Expires is definitely an HTTP header area that can't be set by jQuery.

But you could attempt to include an HTTP equivalent [cde] element:


However it is dependent around the user agent if this kind of HTTP equivalent $("head").append('<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">') element is recognized. The greater way is always to set that within the HTTP header.

Incidentally: In HTTP 1.1 the Cache-Control header field with max-age parameter is preferred over Expires (see Modifications of the Basic Expiration Mechanism).

The META header is outdoors from the actual page itself, it's meta-data that the server contributes to reactions to point towards the client how lengthy this content applies for.

Ultimately, it's as much as the server to create the response headers. You can do this globally, to ensure that all content sent in the server has got the same values. Or, if you are utilizing a server-side platform (like ASP.Internet, PHP, etc) you'll be able to set the Expires header programatically as well as on a per-resource (page) basis.

However, it may sound like you need to simply set them globally--which normally is performed having a server-setting.

For Apache have a look at mod_expires

For IIS7, take a look at this

For other server platforms, just try searching "Howto set expires header " with being whatever platform/version you'll need.

And also to clarify what they're If your browser has formerly retrieved an origin (say, myPage.html), which resource comes with an expiration of 24h, then your browser is basically being told "by trying to load this site again within the next 24h, you can easily show the version you formerly retrieved instead of asking for a brand new copy in the server".

For static pages this is often ideal--an extended expiration can lead to faster page-loads for the customers (the browser saves outings towards the server) and also the server needs to handle less demands.

But also for dynamic pages getting a lengthy-expiration could be harmful. Make a page which just informs time like Expires (in which the server creates the HTML). When the expires header is placed to something similar to 1h, it the browser may show the consumer "1:01 EST" if this shoudl be "1:45 EST", etc.

If you want to clearly disable browser-caching (different browsers use different defaults, ie: IE8 is extremely aggressive about caching), you'll be able to set <h1>1:01PM EST</h1> that is basically saying the page expires immediately.

An Expires=-1 header can be used for HTTP caching and signifies the following date/time where the present version from the object is no more current. This can be by browsers and HTTP caches to lessen the burden on source web servers.

You will find another headers involved with caching that you ought to also investigate like Expires and ETag.

See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13