Skip to content Skip to sidebar Skip to footer

How To Cache Scripts And Images From My Site?

Question :::::: I have been trying to create a site (Hosted on x10hosting). So I have been searching how to build a fast site. And I got a page to improve Jquery codes. Below is

Solution 1:

Chances are that as long as you use normal, static files (ending in .js, .gif and so on), your server already does caching for you.

You can find out using a tool like Firebug in Firefox, or the built-in developer console in Chrome. The easiest way to get there is by right-clicking an element, and choosing "Inspect element".

If you switch to the "Net" tab, you will see all the requests that had to be made for the current file.

enter image description here

304 not modified and (from cache) means that the resource was not loaded again. If you see those for static resources, there is some caching already in place. The main document usually gets reloaded every time; the same goes for tracking codes like Google Analytics, and Ads. On a big site, you will expect to see a number of 200 OK requests as well.

In the tab, you can also find out the response headers of each resource. This tutorial could help deciphering what each header means: Caching Tutorial for web authors and webmasters

Fine-tuning caching is a very complex field. Here is a question that deals with caching images on Apache. Stack Overflow has a variety of existing questions on this.

If you want to generally look into speeding up your site, check out this question: Optimizations to reduce website loading time

Solution 2:

As pekka said fine tuning caching is a very complex field. I recommend beginning with the book "High Performance Web Sites" and follow yahoo performance blog.

Solution 3:

As they go x10 is pretty good for a fee web host, any real speed issue is going to be with MSQL if your site uses a large database.

Getting all your javascript (.js)and css into external files [hosted wherever] so they can be cached inside the visitors browser for re-use is a good place start. (most people know that images cache, but are often unaware that css and js files cache also)

Another useful trick is that of Client Side Includes, whereby chunks of html that would normally have to be moved from the server to visitor every time the page loads can also cached inside the browser by wrapping the html inside a javascript file.

Post a Comment for "How To Cache Scripts And Images From My Site?"