markjaquith/WP-TLC-Transients — pull request #6 by rosswintle (2012-03-13 11:06:16+00:00)
Title: Addition of prevent_background option

Hi Mark,

I've never contributed to an open source project before, so I'm starting small.

You may not want to adopt this little change/addition because using the new option wipes out most of the benefits of using TLC Transients in one fell swoop, but let me explain.

It turns out that there are some hosts out there that don't allow "loopback" HTTP requests. So the server running on http://my-domain.com can't make an HTTP request to http://my-domain.com

This has, I have found, at least two symptoms:
1) wp-cron doesn't work
2) TLC Transients doesn't work

I found this out through Twitter Widget Pro not updating correctly. A write up is here: http://oikos.org.uk/2012/03/tech-notes-twitter-widget-pro-not-updating-for-heart-internet-users/

I initially suggested to the author of Twitter Widget Pro that he make use of TLC Transients optional in his plugin, but that would mean reworking all of his transient handling code. Easier, I thought, to add a "suppress background requests" option to TLC Transients.

So that's what I've done.

Like I say, I don't mind if you don't adopt the change, but I've done the work so I thought I'd at least submit it to you for review.

As I say I've never contributed to someone else's code before so I've hope I've done it all right with the GIT Pull Request and so on.

Thanks!

Ross Wintle