1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to increase the website speed with .htaccess

Discussion in 'PHP' started by dineshsingh1984, Jan 24, 2015.

  1. #1
    Please tell me how to increase the website speed with .htaccess????????????????
     
    dineshsingh1984, Jan 24, 2015 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. King-Servers

    King-Servers Greenhorn

    Messages:
    269
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    23
    #3
    You can also improve the website speed with a CDN service like Cloudflare.
     
    King-Servers, Jan 26, 2015 IP
  4. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #4
    Actually first identify WHY your web site is slow.

    Common reasons for a slow web site:

    - Overcrowded shared server.
    - Database calls not using or misusing INDEXES
    - Server side scripts loading a ton of dependencies without opcode caching
    - More traffic than your hardware can handle
     
    NetStar, Jan 29, 2015 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #5
    In and of itself, .htaccess is SLOWER, at least compared to making changes to your httpd.conf -- which if you want a lot of the settings people are talking about here is where they should be set.

    The dicking around with expiration times is silly; cache is a limited quantity that will likely get flushed LONG before any of those values do a damned thing. It's one of the biggest lies in web development and generally speaking a colossal waste of time no matter how many "experts" claim otherwise... <drEvil>"lasers"</drEvil>

    Turning on mod_deflate is always a good idea -- gzip compression takes little time, on properly configured servers will be cached, and cuts down on network traffic. It CAN work against you though if your hosting is sub-par and you don't have enough CPU power to spare on doing it in realtime. This is why only files that deliver high compression returns (basically anything that's plaintext like HTML, CSS, JS and XML) should be set to compress, since things like JPEG files already have their own compression and you get almost no extra savings for the CPU time spent.

    Though @NetStar raises a VERY good point... usually if you have a slow site playing goofy games with the server configuration typically won't deliver much; the same can be said for things like minification and white-space compression as these days file sizes is less important than the number of files the site is built from. If you have a bloated slow train wreck of scripttardery built from a hundred or more separate files, OF COURSE IT'S SLOW. There's a LOT of site optimization and "don't do that on a website" you should be looking at LONG before you start blaming your hosting.

    We'd have to see the site in question; but if for example you used a bloated off the shelf turdpress template that's loaded down with idiotic framework nonsense like bootcrap or foundation, further bloated with idiotic halfwit nonsense like jQueery and endless pointless scripts for nothing -- and a fair share of art faygelah images as part of the layout that adds nothing of value to the content -- well, you've got bigger problems than your hosting.

    I'm not saying that's what you actually have -- but it's a educated guess and entirely what I've come to expect these days.
     
    deathshadow, Jan 30, 2015 IP
  6. 1waylinkbuilding

    1waylinkbuilding Active Member

    Messages:
    183
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Each other simple straightforward arrangement that does NOT oblige any change to the code is to utilize the Varnish reserve.

    Varnish Cache is a web application quickening agent otherwise called a reserving HTTP reverse intermediary. You introduce it before any HTTP server.

    Straightforward to the PHP application! Reserve demands and serve results, bypassing the basic application. Astute!

    On the off chance that you have SSH access to your server, you can introduce it: varnish-cache.org
     
    1waylinkbuilding, Jan 31, 2015 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #7
    Wow, that's some serious "Englisc, mōdor wyrter! Gedōn ēow cweþan hit!?!" -- lemme guess, Google translate?

    That said, Varnish is another of those bits of "needlessly complicated bull" usually used by people too lazy to fix the actual underlying issues like endless scripttardery and other forms of pointless page bloat. 90%+ of websites that see "benefits" from using it would see far bigger benefits if they stopped crapping together pages any old way.

    Just look at these forums which I know for a fact has varnish under it -- maybe if it stopped wasting 1.5 megabytes in 41 files -- almost a megabyte of that ALONE being halfwit scripttardery -- on delivering single digit K of text it wouldn't "need" garbage like Varnish.

    Especially with all the extra "polling for nothing" crap ajaxtardery as well - laughably making these forums less useful than it was a decade ago in the name of "added functionality".
     
    Last edited: Jan 31, 2015
    deathshadow, Jan 31, 2015 IP