Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_query_vars() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_where() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_join() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_tag_templates() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 160
Illudium » Blog Archive » Podcasting should not be expensive - Part 3
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_add_ajax_javascript() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 160

Podcasting should not be expensive - Part 3


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/illudium/illudium.com/wp2/wp-includes/formatting.php on line 74

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_the_content_filter() should not be called statically in /home/illudium/illudium.com/wp2/wp-includes/plugin.php on line 57

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /home/illudium/illudium.com/wp2/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /home/illudium/illudium.com/wp2/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 638

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /home/illudium/illudium.com/wp2/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

Strict Standards: Non-static method UltimateTagWarriorActions::regExEscape() should not be called statically in /home/illudium/illudium.com/wp2/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-actions.php on line 639

In Part 2, I set up my site's .htaccess file to redirect requests from my media directory to the Coral Content Distribution Network. As I monitored my logs, I saw that Coral requested my first podcast about twice a day. That's because my site wasn't telling Coral how long it was safe to cache the file. Coral could also request the file more often than expected if it was flushed from the cache by other files, but there's nothing I can do about that.

Coral is sort of an opt-in cache, in that I am redirecting my users to the cache. There are many other caches on the web though. ISPs use them to speed up their customers' access to popular sites. Many businesses that use a proxy server for web access also turn on the proxy's cache, so that when everyone goes to the popular sports and news sites they doesn't clog the internet connection. This type of cache is called a transparent cache because it sits between the end user and the internet and substitutes cached resources for requested remote resources. There's nothing you can do about these caches, but you can help them help you by telling them how long your files are valid.

Once again, an .htaccess file comes into play. I put the following .htaccess file in my media directory:

ExpiresActive On
ExpiresDefault "access plus 1 year"

The first line turns on expiration headers. The second line sets the default expiration time for files in the directory to the time of last access plus one year. You could use 1 month or 1 day if you're more comfortable with that. I don't expect the files in my media directory to change. I didn't see any point in setting the expiration any longer than a year, because it's doubtful any cache would keep a file that long if nobody requested it. I also expect people to download files from links on my pages or feeds, so if I do need to replace a file, I can simply rename it and change my link. You can check that the expiration headers are being sent by using a program that shows you the headers. Most download managers do this. You should see something like this in the headers:

cache-control: max-age=31536000
expires: Thu, 23 Nov 2006 00:17:49 GMT

Note that the time on the first line is in seconds. You may need to ask your hosting provider to include the mod_expires module so you can use expiration headers. So far, my host Dragonfort has had everything I've needed available. Here's a link to the documentation for mod_expires on the Apache website.

You might wonder why I haven't set up expiration headers for things like my main page. I will, but there's something else I need to do first. Also, I said above that I don't expect the files to change, but I didn't say they were going to stay on my server. Stay tuned.

Comments are closed.


Bad Behavior has blocked 174 access attempts in the last 7 days.

Creative Commons License