News for hackers. Stuff that matters.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by mdolon on Thursday April 22, 2010 @12:20AM (#1284146)
If your problem is CPU usage rather than bandwidth overage, consider switching from Apache to nginx. I found my LAMP WordPress blog (hosted on a small VPS and using W3 Total Cache) was having trouble with concurrent users - traffic spikes would make my CPU usage skyrocket.

I've since switched to nginx and the results have been great under moderate to high traffic, and without the use of any caching plugin.

Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @01:02AM (#1284228)
I heard that advice about nginx, but was concerned about lack of a mod_rewrite module for smart URL structure. Is there a way to have search-engine-friendly-urls easily with nginx?
Re:How I reduced Page Load Time by 75% - WordPress Optimization by patio11 on Thursday April 22, 2010 @01:45AM (#1284281)
Nginx configuration is about as powerful as Apache, and personally easier for me to grok, but you have to be able to get past the lack of documentation.

Here's the configuration file from my new project -- with the domain name removed. I've marked the magic bits that gets you Wordpress pretty URL compatibility. If you're actually asking about more complicated rewrites, those are all possible too -- look at the Nginx rewrite module docs.

http://www.pastie.org/929223

Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @01:52AM (#1284292)
That's a much more attractive configuration file than an Apache one.

I see that you're using FastCGI. Something I didn't mention was that I attempted to use FastCGI, but gave up because my memory usage kept snowballing until I had to reboot my server over and over again. I don't know for sure whether it would have made things any faster.

Re:How I reduced Page Load Time by 75% - WordPress Optimization by IgorPartola on Thursday April 22, 2010 @07:15AM (#1284726)
Here's the simplest way I've found how to do it. There is also a snippet of Nginx config floating out there for enabling SuperCache (and I assume Total Cache would be easy to implement too). I am able to run 8 FastCGI processes + nginx + MySQL (with InnoDB) on a 256MB VPS, but YMMV. Overall, nginx is awesome.

http://igorpartola.com/web-development/how-to-set-up-nginx-w...

Re:How I reduced Page Load Time by 75% - WordPress Optimization by pierrefar on Thursday April 22, 2010 @03:36AM (#1284410)
Use php-fpm with enginx and you're golden. I ran a website getting millions of requests daily and it worked a treat on a small EC2 instance.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by jf on Thursday April 22, 2010 @03:37AM (#1284413)
David, Nginx is awesome.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @10:46AM (#1285205)
No, you're awesome, Jöel
Re:How I reduced Page Load Time by 75% - WordPress Optimization by shin_lao on Thursday April 22, 2010 @09:28AM (#1284979)
I recently posted about configuring a BSD machine to run Wordpress on nginx, hope it helps.

http://www.bureau14.fr/blogea/index.php/2010/04/setting-up-a...

Re:How I reduced Page Load Time by 75% - WordPress Optimization by WillyF on Wednesday April 21, 2010 @11:24PM (#1284018)
W3 Total Cache really is a fantastic plug-in. It's significantly reduced my server load, and hasn't caused any problems as far as I can tell.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by pavs on Thursday April 22, 2010 @12:04AM (#1284108)
Yup, I have been using it with maxcdn (PULL) and other custom optimization; was able to go from ~8sec load time to less than 2 second load time on average.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @12:25AM (#1284158)
I just wish that they had support for rotating through multiple subdomains, so I wouldn't have to do it manually.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by thedevelopment on Thursday April 22, 2010 @12:13AM (#1284127)
What an excellent post, and easy enough for someone without tech experience to follow. This will definitely be forwarded to friends wanting to get into the more serious side of web publishing.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by MichaelApproved on Thursday April 22, 2010 @12:27AM (#1284162)
Great tips. The most useful one for me is to put images and script files on a subdomain.

Doesn't adding CSS and JavaScript inline hurt your google rank?

Re:How I reduced Page Load Time by 75% - WordPress Optimization by moultano on Thursday April 22, 2010 @01:33AM (#1284263)
>Doesn't adding CSS and JavaScript inline hurt your google rank?

Why would it do that?

Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @01:37AM (#1284270)
As I talked about in the post, I have some pages that are popular with search engine visitors. They generally come to the page, read, and then leave. I serve CSS and Javascript in <style> and <script> tags on those pages so it's fewer HTTP requests, and loads faster.

Unless someone has a reason I should do otherwise?

UPDATE: From Yahoo: http://developer.yahoo.net/blog/archives/2007/07/rule_8_make...

"The key factor, then, is the frequency with which external JavaScript and CSS components are cached relative to the number of HTML documents requested. This factor, although difficult to quantify, can be gauged using various metrics. If users on your site have multiple page views per session and many of your pages re-use the same scripts and stylesheets, there is a greater potential benefit from cached external files."

Re:How I reduced Page Load Time by 75% - WordPress Optimization by MichaelApproved on Friday April 23, 2010 @10:31PM (#1290140)
I think I was confused with mixing content with code. Putting style information in tags seems to be bad but not in the header. Even Google seems to use inline script/style code in the head of their website.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @12:32AM (#1284172)
I'm not sure about that inline issue - I hadn't heard that. I actually got that advice from Yahoo, I think. The inline Javascript and CSS makes the page load faster, so in theory it would help.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by Isofarro on Thursday April 22, 2010 @01:38AM (#1284271)
That is true if you have a one page site. Bundling all the JavaScript and HTML in with the CSS means downloading one HTTP resource instead of three. This is good for sites like the "Yahoo Homepage" - basically just one big page, Netvibes, Facebook.

But if you have multiple pages sharing the same styles, yes for once off load times, having the CSS and JavaScript inpage is better, but for a visit of more than one page, having the CSS and JavaScript as separate cacheable resources is far better, since the differences are now the page size of the pure HTML plus images, saving at least the packet sizes needed to transfer the same CSS and JavaScript on each page.

So the major multi-page properties of Yahoo use primarily one external CSS and one external JavaScript file on each property.

Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Thursday April 22, 2010 @01:49AM (#1284287)
Thanks for that explanation. Based on what you said, I think I'm approaching it okay. On a few posts that have really high bounce rates, I use the Custom Post Template to serve CSS and JS inline on those pages (amongst other customizations). The rest of the site, I load them from external files.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by jusob on Thursday April 22, 2010 @08:22PM (#1286860)
"A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy". In reality, it is 6 in IE 8, 8 in FF 3.x, Safari and Opera
Re:How I reduced Page Load Time by 75% - WordPress Optimization by kadavy on Friday April 23, 2010 @02:24PM (#1289022)
Thanks for that. I heard something similar but couldn't find records of specifics. I suppose that means that its 6 in Chrome as well.

And of course, there is IE7, which is still what many of my visitors use.

Re:How I reduced Page Load Time by 75% - WordPress Optimization by volomike on Thursday April 22, 2010 @12:04AM (#1284109)
Re:How I reduced Page Load Time by 75% - WordPress Optimization by wanderr on Thursday April 22, 2010 @12:14AM (#1284132)
What does that actually do? All the description says is that it saves you bandwidth.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by jleader on Thursday April 22, 2010 @01:54AM (#1284294)
The "FAQ" link below the description leads to:

"Chennai Central is a bandwidth saver plugin that makes your wordpress site support conditional GETs by search engine crawlers , feed readers and more."

(followed by more detail about what conditional GETs are, and why they help)

Re:How I reduced Page Load Time by 75% - WordPress Optimization by wanderr on Thursday April 22, 2010 @02:46AM (#1284361)
For me the FAQ was empty, maybe a compatability problem with Android's browser. I'll check it out on a real computer.
Re:How I reduced Page Load Time by 75% - WordPress Optimization by kree10 on Thursday April 22, 2010 @08:31AM (#1284858)
Never mind the FAQ, the "Download Now!" link is a 404.

I'm kind of surprised that in 2010 stock Wordpress would not have this kind of cache-friendliness built in.

Re:How I reduced Page Load Time by 75% - WordPress Optimization by c00p3r on Thursday April 22, 2010 @07:35AM (#1284753)
Moving to Xen-based VPS with fast connection from dedicated server. Big deal.

For me it looks much better to rent a dedicated server and divide it into several KVMs and resell them. =)