No-cache Files with WordPress Multisite

Creating a WordPress Multisite for a client I came across an issue when trying to prevent flash files (.swfs) from being cached (stored by the browser).

You can’t use normal Apache .htaccess files when serving files from within WordPress multisite because they get funneled through a PHP file, located in wp-includes/ms-files.php. You can check for any filetype, I checked for .swf files. Here’s my modified code:

$last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) );
$etag = '"' . md5( $last_modified ) . '"';
header( "Last-Modified: $last_modified GMT" );
header( 'ETag: ' . $etag ); /* no cache swf files - K.Mo*/
if(preg_match("/.*\.swf/i", $file)) {
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT');
header( 'Cache-Control: max-age=0, no-cache, no-store, must-revalidate');
header( 'Pragma: no-cache');
}
else {
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );
}

You’ll need to check if WordPress gets updated because this file is part of the core WordPress insall and will liekly be overwritten when there’s an update. I’ll keep this page updated if there’s a better way to accomplish this task.

HTML5 Video – Updated Stats and Workarounds

HTML5 video is still a mess. 3, possibly 2 video formats, incomplete browser support, and bad UI for Android devices. Not all is lost. If you’re brave enough to create your own HTML5 videos on your site or blog, check out LongTail Video’s HTML5 Reference Guide.

YouTube as HTML5 Video Helper

As I mention in the podcast, YouTube is one way to go to save yourself the encoding hassles. It also exposes your video to the huge YouTube audience and you get optimized video for all devices. KenMorico.com was one of the first Web sites that featured HTML5 video back in June 2010 and I learned a lot of lessons.

Podcast

Play

More Info:

Real-time Marketing: Why it Probably Won’t Work for the Little Guy

The concept of real-time marketing really blows my mind. It’s what happens when you combine the fast-indexing Googlebot with breaking news and large online audiences. Getting noticed with paid advertising only gets you so far. Injecting your company or yourself in the news in real-time gives you tremendous leverage. But to play with the big boys and get noticed there’s a problem. You need to rank well in search.

Some large companies can do this because their Websites have been around for a long time and are usually updated by people in the organization who get paid to do it full-time. Successful individual bloggers with good page-rank will almost certainly outrank any small business. New blogs, even with some search engine optimization, will usually drop to the lower ranks in search pages.

Here’s a great video explaining real-time marketing and how it can be done featuring David Meerman Scott:

David Meerman Scott from National Speakers Bureau on Vimeo.

I do have some ideas about how to increase your chances for a higher news ranking. Subscribe to the blog and stay tuned. In the meantime, see this reader-favorite post on juicing your site performance for the new Google.

7 Social Media Podcast Episodes Worth Listening To

While I like reading blog posts and written content in my Google Reader, I love listening to podcasts. I get fatigued doing so much reading — especially during the work week. I really enjoy listening to podcasts at night. I’m a lot more focused and podcasts are just more entertaining and portable. There aren’t many podcasts on the topic of social media, but I found a few with some insightful episodes worth a listen.

LINKEDIN / CAREER

Managing Your Career Online | Trafcom News Podcast - An interview with Martin Buckland about managing your career online.

LinkedIn tips from Chuck Hester | Trafcom News Podcast - Chuck Hester’s advice for getting more value out of LinkedIn; using Groups and Answers.

NEWSJACKING

Newsjacking | Marketing Over Coffee Podcast - David Meerman Scott’s new book Newsjacking / Newsjacking as Real Time Marketing /  The Lifecycle of a News Story / Good Judgement, Newsjacking and Larry Flynt.

Newsjacking | Six Pixels of Separation Podcast - David Meerman Scott discusses Newsjacking and riding the news.

CONTENT MARKETING

David Spark on Content Marketing | For Immediate Release Podcast - Shel Holtz talks with David Spark about companies becoming publishers, how to ensure that content is shared and how to assess its value.

WHAT ABOUT BLOGS?

Dell Chief Blogger Lionel Menchaca | For Immediate Release Podcast - Where do blogs fit in the social media mix? Lionel Menchaca talks about Dell’s overall social media approach and its evolution.

TWITTER AND NEW JOURNALISM

Journalism and the New Media with Jay Rosen | Six Pixels of Separation Podcast - Jay Rosen talks with Mitch Joel about new media and journalism.

Blogging is Dead. Again?

Does anyone remember the day blogs died? If you keep up with the social media crowd there’s a lot of linkbait posts describing the end of blogging. They say status updates and new services like Google+ have killed long-form content and traditional blogs. What hyperbole!

Yes, there are new services. Faster services. Services that feed the ego and spin content. I believe short-form content has its place. But after awhile short-form content makes me feel like I’ve been in Vegas for a week listening to the ringing of slot machines non-stop. Twitter never stops. Good content, bad content — it’s just too much and the pressure to Tweet is great because you feel you will be left behind. In fact, if you Tweet or post status updates your Klout score stagnates or reverses. That’s just wrong.

No Filters, No Credibility

That fact that someone even has a blog immediately gives them more credit in my eyes. It shows some commitment and competence – like getting a suit for an interview or certification. Anyone can setup a Twitter or Tumblr account. Great. The double-edged sword is that anyone can create content without filters. With the death of professional journalism we’ve lost our filters. That’s a shame.

Shortform Content, Twitter, and a Harmonic Future?

Can you explain your thoughts in 140 characters? Unless everyone is a Haiku master, I don’t think so. The drivel that permeates the short-form content sites makes me think society has regressed 10,000 years. Blogs enable quotes, research, photo essays, multiple videos, attribution, trackbacks, hundreds of comments, the list goes on. Sure short form is great for events and live reporting like I described in my post The New Digital Storytelling – On the Road with Twitter where I documented a night of public transportation in Houston. I think Jack Kerouac would have loved to see Twitter, but disappointed in its impermanence and superficiality. I think integrating Twitter statuses in a blog post for some event might have some kind of future… letting users experience the best of both.

News Organizations are Not Blogs

Jeremiah Owyang created a blog post titled, “End of an Era: The Golden Age of Tech Blogging is Over.” In it he describes how corporate acquisitions have stymied innovation. To me, to have “corporate” and “blogging” together is an oxymoron in itself. I believe corporations should have a place for content, but I wouldn’t compare it to “blogging.” The same with news organizations that mask as blogs. Mashable and Techcrunch are not blogs. They are news organizations that exist now – a breed of company that can survive in the new economy. Congrats to them. I’ll find interesting content to read / watch / listen to produced by individuals in real blogs.

I’ve seen as blogs get larger, oftentimes the original blogger hires less qualified writers just to feed the Google beast. This is a shame. I lose respect for bloggers that do this. If you build up trust with your audience, treat them well. If you want to see an action movie, you don’t want Sylvester Stallone’s brother instead of Sylvester Stallone… you probably want a comparable like Schwarzenegger or Bruce Willis. Blogs have hired hacks and I think people should let them know. Talent is what gets people in the door and keeps them there.

The I’m Not Dead Yet Chart

Bloggers Struggling

Bloggers are reportedly making less money this year… must be the end of blogging! Oh no! What business isn’t struggling? The S&P 500 was flat for 2011. I think people will look for new ways to tell stories in 2012 and blogging will evolve. I know I am looking for new ways of storytelling. I’m ok with change. I guess that’s why my blog is still here.