News for hackers. Stuff that matters.
Re:Fighting Back After Hacker News Took Down My Site by bradleyland on Thursday July 14, 2011 @11:13AM (#2763374)
I cringed a little bit when I read this: "...none get enough traffic for me to have made caching or performance tuning a huge priority".

I don't mean to level criticism solely against the post author for this, because he is not alone, but I find this mentality inexcusable. This is especially true if you're using WordPress, for which there are a multitude of caching plug-ins. All of which will offer orders of magnitude better performance than allowing the blogging engine to build the page from scratch every time.

In other words, caching is always a priority. It's not an add-on or an after-thought, it should be part of your design.

Consider a scenario where someone asks you to add up three arbitrary numbers:

123 + 456 + 789

Now, imagine you type those in to a calculator to add them up. It takes you a few seconds. The output is 1368. You can easily remember this number, so the next time someone asks you what the result of 123 + 456 + 789 is, you can just say 1368. Not caching is like keying the numbers in to a calculator every time, rather than just relying on your memory.

I know this is a rudimentary example, and I know that most people running a WP blog probably know how caching works, but even if you don't "need" it today, why would you leave your blog set up so that it's constantly re-building content that can be cached by simply installing a WP plug-in?

I implore you. Make caching the second thing you do (after security) when setting up or building your web app.

Re:Fighting Back After Hacker News Took Down My Site by scott_s on Thursday July 14, 2011 @12:07PM (#2763623)
If they don't have the load, then it's just not at the top of people's priority stack. This doesn't seem like a terrible thing to me. It's not that caching and performance tuning isn't important, it's just that for people who don't have high load, they have many things that are more important to deal with.
Re:Fighting Back After Hacker News Took Down My Site by Lewisham on Thursday July 14, 2011 @01:20PM (#2763943)
I feel that Wordpress should be smarter about this. You shouldn't need to download a plugin to make sure your site doesn't choke.

However, lots of people get confused by caching plugins when they're editing templates and things.

Idea: Wordpress caches pages. It checks to see when its template files were last touched. If they were touched after the cache, it regenerates. Otherwise, the cache is served.

You can have that for free, Wordpress.

Re:Fighting Back After Hacker News Took Down My Site by benmills on Thursday July 14, 2011 @11:19AM (#2763396)
I agree with you when you're taking about web apps, but what about personal blogs?

If I just want to set up a personal blog that I don't plan on promoting or spending a lot of time on I wouldn't want to spend any extra time setting up things that don't help me with my primary goal, writing blog posts.

Re:Fighting Back After Hacker News Took Down My Site by bradleyland on Thursday July 14, 2011 @12:08PM (#2763626)
I totally get that. I'm beyond the phase in my life where I enjoy tinkering with blogging software settings. I'm far more interested in engaging in the conversation. But here's the counter argument: it takes a sum total of 60 seconds to implement. If you're using WordPress to host your blog, installing caching is beneath trivial. You click "Add New" under the Plugins menu, then search for WP Super Cache and click install. The only thing remaining is to turn it on.

If you're not using WP, you might use something like Tumblr or Posterous. In that case, caching isn't your problem. If you rolled your own blogging software, well, you already violated the principle that blogging is your primary goal.

Re:Fighting Back After Hacker News Took Down My Site by scott_s on Thursday July 14, 2011 @04:40PM (#2764997)
It's only trivial if I know that such plugins exist. And if I don't consider how to improve performance because at the moment I don't care, then it doesn't matter how trivial it is.
Re:Fighting Back After Hacker News Took Down My Site by bradleyland on Thursday July 14, 2011 @11:24PM (#2766152)
Hrm. That's a really good point. It's hard for me to see outside the fact that I've set up what seems like a hundred WP blogs in my lifetime. That adds a solid 5 minutes of Googling, which I still think is a pretty minimal commitment.
Re:Fighting Back After Hacker News Took Down My Site by scott_s on Friday July 15, 2011 @10:10AM (#2767400)
But you don't know it's 5 minutes of Googling until you do it. Before you start, it's an unbounded task.
Re:Fighting Back After Hacker News Took Down My Site by benmills on Thursday July 14, 2011 @12:20PM (#2763678)
That is true. At least for personal blogging, I would use a service like Tumblr so I wouldn't have to think about any of these issues unless my blog became very popular.
Re:Fighting Back After Hacker News Took Down My Site by ianlevesque on Thursday July 14, 2011 @12:26PM (#2763712)
This guy has the right idea. My immediate thought when I visit a site and get "Couldn't establish database connection" is "why are they hosting this themselves?" Most people, tech savvy or not, don't need to be managing this stuff themselves.
Re:Fighting Back After Hacker News Took Down My Site by rellik on Thursday July 14, 2011 @01:38PM (#2764037)
FWIW, I just recently switched to self-hosting. I was on blogger before, but moved because I want to retain complete rights to my content.
Re:Fighting Back After Hacker News Took Down My Site by lukeschlather on Thursday July 14, 2011 @12:48PM (#2763808)
That's why I went with static HTML + Jekyll. I only deal with the moving parts when I'm uploading a blog post.

It also increases the barrier of entry to posting something, so I'm less likely to post something inadequate.

Re:Fighting Back After Hacker News Took Down My Site by Vivtek on Thursday July 14, 2011 @12:13PM (#2763648)
* but I find this mentality inexcusable.*

I find that mentality kinda odd.

Re:Fighting Back After Hacker News Took Down My Site by wheels on Thursday July 14, 2011 @12:33PM (#2763754)
Note that caching didn't and wouldn't have significantly helped in this case. It was an inappropriate Apache configuration. No amount of caching will stop a server from falling over when it's running far more Apache processes than it has RAM for. While caching is part of the solution, it's not the high bit (lowering MaxClients and properly configuring KeepAlives is).
Re:Fighting Back After Hacker News Took Down My Site by rellik on Thursday July 14, 2011 @11:18AM (#2763394)
Definitely agree! For me, the counter-point is that there's tremendous value in getting the Minimal Viable Product out the door, and iteratively improving it (the post in question was only the 2nd post after moving off a hosted blog). Projects that I want to be perfect before release usually don't make it out the door.

Plus, I'd grown lazy from my lack of traffic :)

Re:Fighting Back After Hacker News Took Down My Site by voidfiles on Thursday July 14, 2011 @11:59AM (#2763582)
I agree. Also why not use a full page cache, WP super cache allows you to generate the HTML version of your site and then serve the static HTML you don't even need to spin up the PHP.
Re:Fighting Back After Hacker News Took Down My Site by jules on Thursday July 14, 2011 @01:06PM (#2763878)
Why doesn't WordPress cache by default?
Re:Fighting Back After Hacker News Took Down My Site by jasonlotito on Thursday July 14, 2011 @03:52PM (#2764748)
The TL;DR: Persistent caching isn’t needed for most sites and is a pain to get working in all hosting environments. Instead WordPress makes it really easy to install a caching plugin if you need it.

http://www.viper007bond.com/2010/08/10/why-wordpress-doesnt-...