There are many ways to optimize your web pages. In addition to reducing HTTP requests and delivering compressed files, we can also minify code content. The easiest way to minify your CSS is to run it through an online code minifier, which automatically eliminates extraneous characters to reduce file size. Minification shrinks file size significantly, by as much as 30% or more (depending on input code). This size-reduction is the net result of numerous micro-optimization techniques applied to your stylesheet. By learning these techniques and integrating them into your coding practice, you’ll create better-optimized CSS during the development process. Sharper skills, cleaner code, faster downloads – it’s a “win-win” for everyone.
In this Perishable Press article, you’ll learn how to write leaner, cleaner CSS using 10+ micro-optimization techniques..
The basic idea behind micro-optimizing your CSS involves writing clean code, eliminating extraneous characters, and reducing overall file size. And you don’t have to rely on an automated script to do everything for you. Instead of writing lazy, sloppy, bloated code and then just dumping your hideous CSS into an automated minifier, it’s better to understand and practice as many micro-optimization tips as possible, given your particular coding style and specific project requirements.
Continue Reading
Preloading images is a great way to improve the user experience. When images are preloaded in the browser, the visitor can surf around your site and enjoy extremely faster loading times. This is especially beneficial for photo galleries and other image-heavy sites where you want to deliver the goods as quickly and seamlessly as possible. Preloading images definitely helps users without broadband enjoy a better experience when viewing your content. In this article, we’ll explore three different preloading techniques to enhance the performance and usability of your site.
Method 1: Preloading with CSS and JavaScript
There are many ways to preload images, including methods that rely on CSS, JavaScript, and various combinations thereof. As one of my favorite topics here at Perishable Press, I have covered image preloading numerous times:
Continue Reading
In my article, Associate Extensionless Files with Notepad, I explain how to navigate the labyrinthine maze of Windows dialogue menus to assign Microsoft’s Notepad text editor as the opening application for files without extensions. In this post, I’ll show you how to associate any file type with any program (including Notepad) in less than five seconds.
Ready? Don’t blink, you’ll miss it.. ;)
Modify any file extension association in five seconds
Open the Windows command prompt and enter the following command:
assoc .extension=fileType
It’s that easy. What is happening here? Let’s break it down, just for fun:
assoc — Windows file-association command
.extension — the extension of the file for which you would like to associate
fileType — the type of file that you would like to associate with your extension
Continue Reading
In my previous article on WordPress title tags, How to Generate Perfect WordPress Title Tags without a Plugin, We explore everything needed to create perfect titles for your WordPress-powered site. After discussing the functionality and implementation of various code examples, the article concludes with a “perfect” title-tag script that covers all the bases. Or so I thought..
Some time after the article had been posted, Mat8iou chimed in with a couple of ways to improve thie script by cleaning up tag names and specifying page numbers for archive views. Apparently, by replacing the $tag variable with WordPress’ built-in single_tag_title();, titles for Tag-Archive page views will display the tag’s “pretty” name rather than the unformatted version. For example, the tag for Pink Floyd will be displayed correctly as “Pink Floyd” rather than the less friendly “pink-floyd”. And so on.
Continue Reading
A great way to save bandwidth is to take advantage of Google’s AJAX Libraries API to serve your favorite open-source JavaScript libraries. Here is how Google explains it in their official documentation:
The AJAX Libraries API is a content distribution network and loading architecture for the most popular open source JavaScript libraries. By using the google.load() method, your application has high speed, globally available access to a growing list of the most popular JavaScript open source libraries.
Continue Reading
My favorite series of articles here at Perishable Press, the “Obsessive CSS Code Formatting” articles explore the esoteric minutia involved with producing clean, well-formatted CSS code. From indention and spacing to opening and closing brackets, the obsessive CSS code series explores techniques and tricks used to transform ordinary stylesheets into streamlined masterpieces of inspiring beauty. Creating poetic CSS integrates the high art of employing consistent coding patterns and formatting methods with the practical functionality of proper syntax, logical structure, and concise delivery. These posts are extremely subjective, opening dialogue concerning the obsessive-compulsive behavior many of us embrace while implementing the powerful and essential coding language that is CSS. So, without further ado, here is a periodically updated list showcasing the all of the currently available articles in the series..
If you have yet to do so, Subscribe to Perishable Press for all the latest CSS formatting tips!
Keeping an eye on all things WordPress, I have noticed an ongoing fascination with configuring the ultimate WordPress <title> tags. Many bloggers use various plugins to generate differently configured <title> tags depending on particular page views. A good example of this is seen in the All in One SEO Pack, which, among many other things, enables users to specify custom titles for several different types of pages. While there is nothing wrong with this approach, some of us prefer to run WordPress with as few plugins as possible. If you want to create perfect WordPress title tags without a plugin, this post will certainly help you do it. First we’ll explore some of the basics, continue with some common examples, and then conclude with a comprehensive, highly flexible script for generating distinct page titles. All of the techniques presented in this article should work well with virtually all versions of WordPress.
The Basics
The <title> tag is used within the <head> section of (X)HTML pages to communicate the title of the document to both humans (your visitors) and machines (search engines). For dynamically generated sites, such as those powered by WordPress, many different types of pages exist, including:
Continue Reading
Before Summer arrives, I need to post the conclusion to my seasonal article, Perishable Press HTAccess Spring Cleaning, Part 1. As explained in the first post, I recently spent some time to consolidate and optimize the Perishable Press site-root and blog-root HTAccess files. Since the makeover, I have enjoyed better performance, fewer errors, and cleaner code. In this article, I share some of the changes made to the blog-root HTAccess file and provide a brief explanation as to their intended purpose. Granted, most of the blog-root directives affected by the renovation involve redirecting broken/missing URLs, but there are some other gems mixed in as well. In sharing these deprecated excerpts, I hope to inspire others to improve their own HTAccess and/or configuration files. What an excellent way to wrap up this delightful Spring season! :)
Continue Reading
Recently, I found occasion to consolidate and localize my WordPress feeds. A couple of years ago, shortly after I first began using Feedburner to deliver and monitor my site’s feeds, I began listing my Feedburner-assigned feed URL in addition to my localized WordPress feed URL. As time went on, inconsistent feed linkage here at Perishable Press had greatly convoluted the feed-subscription process. Confounding factors include:
Continue Reading
While developing the 3G Blacklist, I completely renovated the Perishable Press site-root and blog-root HTAccess files. Since the makeover, I have enjoyed better performance, fewer errors, and cleaner code. In this article, I share some of the changes made to the root HTAccess file and provide a brief explanation as to their intended purpose and potential benefit. In sharing this information, I hope to inspire others to improve their own HTAccess and/or configuration files. In the next article, I will cover some of the changes made to the blog-root HTAccess file. As always, suggestions and questions are always welcome — just drop a comment below! Have fun!! :)
Continue Reading
During the recent ASO server debacle, I raced frantically to restore functionality to Perishable Press. Along the way, one of the many tricks that I tried while trying to fix the dreaded “white screen of death” syndrome involved increasing the amount of PHP memory available to WordPress. This fix worked for me, but may not prove effective on every installation of WordPress. If you are unsure as to whether or not you need to increase your PHP memory, consult with your host concerning current available memory 1 and overall compatibility with a localized increase. Note that if your blog is running fine, there is probably no need to employ this solution. I recommend this change only if you are experiencing PHP-related and/or PHP memory issues associated with any of the following:
Continue Reading
How to streamline and maximize the effectiveness of your WordPress URLs by using htaccess to remove extraneous post-date information: years, months, and days..
Recently, there has been much discussion about whether or not to remove the post-date information from WordPress permalinks 1. Way back during the WordPress 1.2/1.5 days, URL post-date inclusion had become very popular, in part due to reports of potential conflicts with post-name-only permalinks. Throw in the inevitable “monkey-see, monkey-do” mentality typical of many bloggers, and suddenly an entire wave of WordPressers had adopted the following permalink structure:
/%year%/%monthnum%/%day%/%postname%/
The benefits of using this format are primarily organizational in nature. Post-date information that is “built-in” to every URL provides immediate, “at-a-glance” knowledge of post “freshness”. Looking ahead ten, twenty or even a hundred years into the future of the blogosphere, there will be trillions of posts and articles, each with their own unique URL. Archived copies of content may or may not include creation date: dynamically archived pages require deliberate database queries, while those archived statically may no longer have access to post-date data. Including post dates in permalinks provides permanent, facilitative record of content origination. Needless to say, most adopters of dated permalinks probably jump on board because the WordPress Admin makes it super-easy to follow the crowd.
Continue Reading
It has occurred to me lately that I no longer use Google Analytics for Perishable Press. Instead, I find myself keeping an eye on things using Mint almost exclusively. So, the question now is: do I continue serving the GA JavaScript to keep the profile active just in case I ever need the additional stats? I mean, Mint already does a great job at recording all of information I could ever need, so I no longer see the use for Google Analytics. I do wonder, however, if Google ranks GA-enabled sites a bit higher than non-GA sites. Hmmm.. it seems to me that there are several options going forward..
Option 1: Continue with Google Analytics
The easiest thing for me to do at this point would be to just leave it alone: continue serving the extra 6.3K/21.4K GA JavaScript (i.e., urchin.js) to site visitors. Sure, I may never actually use the volumes of data I am collecting via Analytics, but hey, who cares, right? Of course, delivering the urchin.js file requires bandwidth and other server resources, and also tends to slow things down a bit, especially on those rare occasions when the Google server bogs down.
Continue Reading
My current adventure into the fascinating realms of site redesign and optimization has yielded several chunks of fruit related to managing and delivering feed content. One of my primary concerns regarding the overhaul of Perishable Press is streamlined content delivery and rights management. An important area of convergence for these two factors involves the management and delivery of a site’s syndicated content. In this article, I explain the shortcomings of many default feed configurations and present an effective overall strategy for better feed management.
When it comes to managing syndicated content, most blogging platforms enable bloggers to provide a multitude of feeds to their readers. For example, WordPress (as well as many other blogging platforms) automatically generates feeds for each of the following channels:
- Main content feed (includes all posts)
- Main comments feed (includes all comments)
- Unlimited number of individual category feeds
- Any combination of individual category feeds as a single feed
- A feed for each the comments given for any particular post
- A feed for each blog author or contributor
- A feed comprised of virtually any combination of the above feeds
Then, as you consider this astronomical number of feeds, multiply each possibility by a factor of at least three: feeds generated via RSS 2.0, RSS 0.92, and Atom formats. Then, as if that were not enough, some bloggers throw third party services such as Feedburner into the mix and link directly to those feeds as well. Now add a zillion non-canonical URL variations into the mix. Eventually, your eyes begin to bug out and you go a little bonkers trying to keep track of them all.
Continue Reading
Approximately 30 days ago, I completely uninstalled the Bad Behavior plugin from Perishable Press. As you may recall, many Bad Behavior users were unexpectedly locked out of their own sites and forced to either uninstall or upgrade in order to fix the problem. Of course, in my perpetual battle to optimize and streamline everything, I decided to drop Bad Behavior from the otherwise obligatory WordPress anti-spam trinity.
30 days later..
I am happy to report that Perishable Press has not seen a noticeable increase in comment spam since the removal of the Bad Behavior plugin. Of course, during the past month, two or three trackback spam turds managed to slide through, however, even Bad Behavior failed to stop everything. This is great news because I prefer to avoid unnecessary plugins whenever possible — especially those of the resource-intensive variety.
Continue Reading
Recently, while attempting to optimize site performance, I found myself experimenting with various caching mechanisms currently available for WordPress. Specifically, I explored each of the following caching options:
While working with the two plugins, WP Cache 2 and Super Cache, I was pleased to discover crystal-clear instructions on each their respective sites. Having access to installation and usage information greatly facilitated the implementation of each of these caching techniques.
On the other hand, finding information about the default WordPress object cache proved virtually impossible. Finally, after locating some decent information, I was able to confirm my initial suspicions and subsequently decided to post a quick article outlining and describing this very straightforward caching method. Although enabling the WordPress cache turns out to be drop-dead easy, it is always good to be sure that you aren’t forgetting a step or otherwise overlooking some important aspect of the process.
Continue Reading
In this article, my goal is to help you optimize WordPress by replacing a few common plugins with their correspondingly effective code equivalents. As we all know, WordPress can be a very resource-hungry piece of software, especially when running a million extraneous plugins. Often, many common plugins are designed to perform relatively simple tasks, such as redirect a feed, display a random image, or return a database value. For those of us comfortable with editing PHP and htaccess code, there is no need to bloat WordPress with additional plugins for the sake of a few routine tasks. For each of the “pure code” alternatives presented below, we are able to drop an unnecessary plugin without editing the WordPress core. In fact, all of the plugin replacements presented here affect only theme files, thereby keeping WordPress updates nice and easy. Well, okay, one or two methods require editing your root htaccess file, but we are all okay with that, right?
Continue Reading
In this article, I discuss how to get the most out of your site’s images by optimizing them for both people and search engines..
![[ Inverted close-up of an optimized flower ]](http://perishablepress.com/press/wp-content/images/2007/misc-chunks/optimized-flower.jpg)
For many sites, images play an important role in the communication process. If used correctly, images have the power to make your articles come alive with clarity and vibrancy. Some visitors may merely notice the image and continue reading, while others will want to know more about your images and dig deeper. While checking out your images, inquisitive guests will explore any clues available to them: alt tags, title tags, and captions, for example. Likewise, when classifying, categorizing, and ranking your site’s images, search engines such as Google employ complex algorithms that evaluate many different image-related aspects in their calculations. Focusing on the details related to image optimization helps both search engines and live visitors to maximize the usefulness of your images. In this article, I present a healthy collection of image-optimization strategies designed to help you get the most from your images.
Continue Reading
By now, everyone is familiar with the Yahoo Developer Network’s 14 “best-practices” for speeding up your website. Certainly, many (if not all) of these performance optimization tips are ideal for high-traffic sites such as Yahoo or Google, but not all of them are recommended for smaller sites such as Perishable Press. Nonetheless, throughout the current site renovation project, I have attempted to implement as many of these practices as possible. At the time of this writing, I somehow have managed to score an average 77% (whoopee!) via the YSlow extension for Firebug.
Of the handful of these tips that I am able (or willing) to follow, number 6 — move scripts to the bottom — is definitely one of the easiest. The reason for doing this is at least twofold:
[…] it’s better to move scripts from the top to as low in the page as possible. One reason is to enable progressive rendering, but another is to achieve greater download parallelization.
— Yahoo! Developer Network
Many people mistakenly assume that the <script> element (and associated contents) must be located squarely in the document <head>, however, this simply isn’t true. As outlined in the official HTML 4.01 Document Type Definition and also in the official XHTML 1.1 Document Type Definition, the <script> element is allowed:
Continue Reading
Now that my recent site overhaul project is nearly complete, I thought it would be useful to share my carefully developed “plan of attack.” The following seven-step strategy is designed to facilitate the entire renovation by logically ordering events and breaking down complex tasks. Upon execution, the following plan is designed to improve overall site functionality, presentation and structure, while factoring in several critical parameters:
- Modular time organization — due to my hectic schedule, it is necessary to break large projects down into manageable chunks.
- Separation of main site from test site — I need a clear distinction between Perishable Press and my many test blogs, pages, and projects.
- Separation of main content from tangential content — distinguishing between main content and other material (e.g., private content, FTP files, etc.) is critical.
- Facilitation of future WordPress upgrades — keeping up with WordPress is important. Before the site overhaul, upgrading was nearly impossible. In fact, the primary thrust of this site makeover is aimed at making it easier to stay current with WordPress.
Thus far, adhering to this plan has helped to eliminate confusion by simplifying an otherwise convoluted project. With this plan firmly in mind, stepping through the entire process happened in a clear, nearly mechanical fashion. Without a doubt, being prepared provided an expediency and thoroughness that would have otherwise remained elusive. Is this the “perfect” plan for renovating a rather large, preexisting site? Probably not. Will you learn something about preparing for and executing WordPress and other site upgrades by reading it? Probably. I suppose, in any case, that even if readers find the proceeding plan all but useless, posting it online is great for prosperity and may even serve useful as future reference material. So, without further ado, here is an outline of the activity recently unfolding behind the scenes here at Perishable Press.
Continue Reading
Two weeks ago, I decided to completely overhaul Perishable Press. The decision came after several months of smooth sailing with excellent site performance, an optimized theme, plenty of visitors, and even a comfortable posting schedule. All things considered, everything was peachy keen — until I began reflecting on the “big picture,” meditating upon certain aspects that are frequently taken for granted or simply overlooked during periods of hectic operation and maintenance. For example, while troubleshooting htaccess and PHP errors, webmasters generally don’t take the time to meditate on the structural and functional integrity of their overall site configuration.
Fortunately, I recently found the time to contemplate Perishable Press from a broader perspective, rethinking everything from themes and plugins to organizational architecture and permalinks. As I approach the completion of the most comprehensive site renovation ever, many significant improvements are currently underway. Here is a summary of the primary changes involving site structure, presentation, functionality and performance:
Continue Reading
For those of you still hiding your bookmarks within the dark confines of your browser’s “favorites” menu, may I suggest stepping into the “here and now” with a fresh new approach: social bookmarking. Hopefully, most of my readers are already familiar with the many wonders of managing and sharing your bookmarks online, but for those who may still be questioning the whole idea, allow me to expound briefly on several of the immediate benefits:
- Universal access to your bookmarked sites
- Forget about time-wasting browser extensions that fumble to synchronize your business; manage your collection online at a great site such as del.icio.us and enjoy quick access to a definitive set of bookmarks from virtually anywhere in the world.
- Better organization of your bookmarks
- Drop the resource-hogging browser extensions that supposedly enhance the organizational efficiency of your collection; many social bookmarking sites employ user-defined tagging architecture to provide unlimited flexibility for organizing your bookmarks.
- Don’t be tight with your bookmarks
- Sharing information is the wave of the future! Help others locate the information they need by sharing your favorite sites with others. Social bookmarking sites like del.icio.us provide a simple way to keep select sites private, so get over yourself and get sharing!
- One-click backups of your entire collection
- Last but not least is the drop-dead simple method that most social-bookmarking sites provide for backing up or exporting your entire bookmark collection. For example, with a single click, del.icio.us exports your entire collection via a nice little html file. Fresh. Delivered.
Ahh.. so much better. If you still don’t believe me, then just stop reading here and go home. However, if you are totally feeling the whole social bookmarking movement, then read on, my friend — I have a few sweet little tips that I would like to share with you..
Continue Reading
Recently, I found myself drowning in an ocean of RSS feeds. Even after switching to Google Reader, which definitely speeds up the process of plowing through posts, I was wasting too much time consuming subscribed content. Thus, in an effort to find balance between saving time and staying current, I executed the following five-step feed portfolio makeover:
- Drop lame feeds. Previously, I had subscribed to a number of feeds simply because they were recommended or mentioned in an article somewhere. Unfortunately, sound referrals and interesting commentary do not necessarily equate with strong syndicated content. I often found myself reading post after post about stuff that was not useful or even interesting. After some careful deliberation, I dropped around 25 of these lame feeds and moved on with my life.
- Consolidate similar feeds. After following my previous collection of feeds for awhile, I began to notice ridiculous amounts of redundancy. There is just no need to subscribe to multiple blogs covering the same material unless they blog from truly unique perspectives. After choosing one or two authority bloggers for each of my focus areas, I unsubscribed to the “echo” feeds and thus reduced my feed collection by at least 20.
- Eliminate overly aggressive feeds. I love to see fresh content from bloggers who post quality posts, especially when they only post once in awhile. It’s like getting a scooby snack or something and I just love it. Conversely, I hate to see overly ambitious bloggers bomb my reader with a jillion junk posts about the same old garbage — nothing new to say and no new ways of saying it. Needless to say, I kicked about 10 of these feed hogs straight to the curb.
- Subscribe to summary feeds. When it comes to staying current with world news, tech news, and other frequently reported topics, it is easy to flood your reader with unnecessary content. Fortunately, many of the most prolific news-related sites provide an alternate summary feed that consolidates and highlights the day’s or week’s worth of material into a single post. By trading full feeds for summary feeds, I greatly reduced the quantity of incoming feed content without sacrificing the quality of its information.
- Drop John Chow like a bad habit. Just kidding. Chow is great, but really, how many blogs about blogging and getting stinking rich do you really need? The point here is to craft yourself a diverse collection of enlightening, educational, and enriching feeds. Trade mindlessness and redundancy for thoughtfulness and original content. Drop the mind-numbing “list” sites and find sincere bloggers with experience and wisdom. I am continually fine-tuning my feed diet towards a diverse, eclectic, and original collection of insightful, high-quality content written by authoritative bloggers who aren’t pitching at me around every corner.
Continue Reading
During the most recent Perishable Press redesign, I noticed that several of my WordPress admin pages had been assigned significant levels of PageRank. Not good. After some investigation, I realized that my ancient robots.txt rules were insufficient in preventing Google from indexing various WordPress admin pages. Specifically, the following pages have been indexed and subsequently assigned PageRank:
- WP Admin Login Page
- WP Lost Password Page
- WP Registration Page
- WP Admin Dashboard
Needless to say, it is important to stop WordPress from leaking PageRank to admin pages. Instead of wasting our hard-earned link-equity on non-ranking pages, let’s redirect it to more important pages and posts. In order to accomplish this, we will attack the problem on three different fronts: admin links, robots.txt rules, and meta tags. Let’s take a look at each of these methods..
Continue Reading
Time is running out! Soon, it will be time for the next Google PageRank (PR) update. While it is difficult to predict how your site will perform overall, it seems likely that your highest ranking pages will continue to rank well. The idea behind this article is to improve your site’s overall pagerank by totally beefing up your most popular pages.
Of course, every page on your site is important. Ideally, you would want to employ these techniques to every article on your site. But time is short, and Google is coming soon! The next PageRank update is slated for any day now, probably before I manage to post this article. ;) Thus, our strategy is to focus on pages that already have some Google juice flowing to them. Your most popular articles. Your best-ranked pages. Your top ten posts.
Continue Reading