Via E-mail:

Making technology easier to understand.

Increase Your Web Site Speed With .htaccess

You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Increase Your Web Site Speed With .htaccess”.

14 people had something to say about “Increase Your Web Site Speed With .htaccess”:

Comments

  1. Michael Aulia -

    That sounds cool, but I’ll let WP-SuperCache plug-in does the job for me (on WordPress) :)

  2. Paul -

    @Michael: The method explained above can actually help the WP-SuperCache plugin. The WP-SuperCache plugin processes the PHP files and creates static HTML pages from them. Each time a visitor requests a page, the static HTML pages are served. The problem without using the above method, is that they the static HTML pages are sent to the browser each time.

    By implementing the caching explained above, you can set an expiration time. This means that if a visitor requests the same static HTML page before it has expired on their local machine, there is no server request as the local copy is displayed. Less round-trips to the server = faster respone times.

    I like to use both, as they compliment each other nicely.

  3. Nihar -

    Great post!!!

    I will implement this directives in .htaccess.

    Thanks again for the great post.

  4. Lyndi -

    Quite some time ago I came across something similar to this. I took notice at the time but then promptly forgot about it. Thanks for the reminder. When I have some time I will experiment with the suggestions made here. Thanks.

  5. Willem Kossen -

    Thanks for this great tip. I’ll be trying it on all my blogs/sites right away. There is however one thing I’ld like you to reply to (if you have time)…

    If people access the site from their cache, I don’t see them in my log. How accurate is my traffic analysis then? (Depending on expiry times of course…)

    Cheers

    Willem Kossen
    http://willemkossen.nl/b

  6. Paul -

    @Willem: Chances are your HTML pages are cached only for a few minutes so they won’t usually be retrieved from the cache, unless your visitors visit the same page within a few minutes. This means that you will see the request in your server logs.

  7. Icon -

    Great tips! I’ll try to implement this technique.
    What will happen if I set CSS expiration date for a week and then within that time I change the theme? Thanks.

  8. Paul -

    @Icon: If you change it before it expires, the browser will probably use the older cached version. One way around it is to include a version number in your files, and then reference the new version. This will cause the visitor’s browser to download the new version. Another option is to change the location of the CSS file, and depending on the theme change, it may be in another directory.

  9. Beth -

    Excellent post and I’m glad I visited when I did. My blog is large-mainly due to the images I use in a lot of my posts. WP-Super Cache, for some reason, does not like my blog at all. I’m going through a clean-up, theme redesign-so what is the best method- to use .htaccess and then enable WP-Cache, which will hopefully work, or, do it the other way around?

    • Paul -

      The caching used by .htaccess is mostly useful for visitors that visit on a regular basis. By setting a time limit of say a week, if they visit any number of times in that week, then they won’t redownload the content, provided they don’t delete their cache.

      WP-Super Cache affects the download speed for all visitors as the PHP files were compiled into HTML files, so there is less overhead. I use both the .htaccess and WP-Super Cache together, as .htaccess affects all content and then sets a cache timeout for the HTML files created by the plugin. I set the WP-Super Cache plugin cache timeout to 600 seconds and the same for .htaccess cache timeout.

  10. Mike -

    Excellent article. I am planning to implement some of these suggestions on my site to improve my load speed. Thanks for these great suggestions.

Trackbacks/PingBacks

  1. [...] Paul from Technically Easy is sharing a post to Increase Your Web Site Speed With .htaccess. [...]

Do you have something to say? Let everyone know!




CommentLuv Enabled