Search For Cache-Control

FREE THOUGHT · FREE SOFTWARE · FREE WORL

  Search Feed

Google

Clusty

Ask.com

Yahoo

Bing

Technorati

An AskApache Plugin Upgrade to Rule them All

apache-server-statusSo my blog as been rather quiet for almost a year now, and very few updates if any have been released for my Password Protection PLugin, my Google 404 Plugin, and definately not for my AskApache CrazyCache plugin, which I will be releasing last… So for all of you who’ve helped me out by sending me suggestions and notifying me of errors and sticking with it… Just wanted to say sorry about that, and thanks for all the great ideas.. Well, I’ve been sticking with it as well believe it our not. I manage to get free days once in a while, and then its time to jam.

Tagged: , , , , | 1 Comment | Continue...




Ultimate Htaccess Tutorial for .htaccess files

.htaccess tutorial and htaccess sampleThis is not an introduction to .htaccessThis is the evolution of .htaccess… The BEST, the ORIGINAL, the NEWEST, and the most HIGHEST, FLYEST .htaccess tricks I can find.

Originally known as the “Ultimate .htaccess Guide”, its changed over the years by adding new .htaccess tricks and .htaccess examples to it.. I also add my favorite .htaccess links, the best .htaccess articles on AskApache, the coolest .htaccess experiments, the Web’s best .htaccess hacks, and update this article on the regular.

Tagged: , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 56 Comments | Continue...


.htaccess trick to show Alternate CSS file based on IP

.htaccess trick to show Alternate CSS file based on IPThis past week I updated my sites apache.css file for a site-redesign. I wanted to make changes to the .css file that only I could see, so that my regular traffic and site-visitors would still see the old version. Here’s the elegant solution I came up with using .htaccess and mod_rewrite that works so well I’m sharing it with all you wonderful and incredible people reading my blog :)

Tagged: , , , , | 4 Comments | Continue...


Optimize a Website for Speed, Security, and Easy Management

Learn how to setup, configure, secure, optimize, and create a low-maintenance website the AskApache way. I’m piecing together all the hacks, tricks, methods, and ideas discussed throughout this blog and all across Netdom and glueing them all together to show you how to have the most optimized, crazy fastest, and best website setup I can think of.

Tagged: , , , , , , , | 5 Comments | Continue...


Pimp out your FeedBurner Count

I’ve had a lot of people ask about the FeedBurner FeedCount image on AskApache. Specifically how to set it up with custom messages and different colors each page view… It is pretty sweet..

Tagged: , , , | Continue...


Notes from Apache HTTPD Source Code

thought I’d take a break from coding and post about how open-source is such a great tool for finding the best answers to the toughest questions,

/** is the status code informational */
#define ap_is_HTTP_INFO(x)         (((x) >= 100)&&((x) < 200))
/** is the status code OK ?*/
 
#define ap_is_HTTP_SUCCESS(x)      (((x) >= 200)&&((x) < 300))
/** is the status code a redirect */
#define ap_is_HTTP_REDIRECT(x)     (((x) >= 300)&&((x) < 400))
 
/** is the status code a error (client or server) */
#define ap_is_HTTP_ERROR(x)        (((x) >= 400)&&((x) < 600))
/** is the status code a client error  */
 
#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
/** is the status code a server error  */
#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
 
/** is the status code a (potentially) valid response code?  */
#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))

Tagged: , | Continue...


Preloading .flv and .mp3 files with Flash

Preload/Cache .mp3 .flv files with Flash ActionscriptIf you want to pre-load .flv / .mp3 files into a visitors browser cache using flash, here’s the actionscript I use to do it, and some ideas behind a good javascript implementation using swfobject or ufo.

Tagged: , , , | 9 Comments | Continue...


Mod_Security .htaccess tricks

Mod_Security rivals Mod_Rewrite in the amount of features it provides. I decided to go ahead and post what I learned about it today, even though its tough to give away such awesome htaccess and apache tricks.. Learn how to control spam once and for all, conditionally log/deny/allow/redirect requests based on IP, username, etc.. Mod_Security is so fine!

Tagged: , , , | 8 Comments | Continue...


.Htaccess rewrites, Mod_Rewrite Tricks and Tips

htaccess rewrite / Mod_Rewrite Tips and Tricks is as glamorous as it sounds! htaccess rewrite mod_rewrite is just possibly one of the most useful Apache modules and features. The ability to rewrite requests internally as well as externally is extremely powerful.

Tagged: , , , , , , , | 57 Comments | Continue...


Crazy Cache WordPress Plugin Released

AskApache Crazy Cache WordPress PluginA WordPress plugin that caches your entire blog for WP-Cache, I love this plugin and finally released it to the public!

19 Comments | Continue...


PHP Sessions/Cookies On The Fly

Multiple Web Technologies for dynamic php session controlThis article shows how to save and modify php session data, cookies, do anything really… without using ajax or iframes or forcing the user make a request.

Tagged: , , | 2 Comments | Continue...


Advanced HTTP Redirection

HTTP Redirection Status Codes, 300Learn about the 7 different HTTP response codes specifically reserved for redirection. 301, 302, 303, 304, 305, and 307.

Tagged: , , , | 2 Comments | Continue...


Hack WP-Cache for Maximum Speed

WP-Cache with Full AskApache HackIf you desire SPEED from your WordPress blog, the #1 speed improvement comes from using the WP-Cache Plugin. If you still desire SPEED after installing the Plugin, you can modify the WP-Cache Plugin code to make your blog even faster!

2 Comments | Continue...


Speed Tips: Add Cache-Control Headers

Cache-Control Headers OnUsing Cache-Control headers you can specify which types of proxies can cache certain content, and how long files should be cached.

Tagged: , , , | 6 Comments | Continue...


Preload flash .flv files into browser cache

How I was able to preload many flash flv and swf files on one of my clients sites that has a lot of online video and relatively small traffic. Their site visitors would usually watch 3-10 videos per visit and so to make the videos load almost instantly on every page I came up with a way to preload the top 10 .flv files and the swf flv player files as soon as the visitor successfully started watching the 1st video. Of course I also setup .htaccess caching on the server so that once they downloaded the files into their cache they would never request them from the server again. I was having fun with this so its pretty funky and uses some really cool combinations of javascript, swf preloader from xml, css classes to help automate it all..

Tagged: , , | 4 Comments | Continue...


Speed Up Google Analytics, use local ga.js

Google Analytics ga.js SpeedHost Google Analytics ga.js file locally for increased speed! Makes web pages load faster.

8 Comments | Continue...


Skeleton .htaccess file for Powweb Hosting

Powweb Web HostingIf you have a Powweb Webhosting account, you will appreciate this simple skeleton .htaccess file for use on their systems.

Continue...


SetEnvIf and SetEnvIfNoCase Examples

SetEnv, SetEnvIf, and SetEnvIfNoCase directives conditionally set environment variables accessible by scripts and apache based on HTTP Headers, Variables, and Request information.

Tagged: , , , , , | 4 Comments | Continue...


Apache Directives and Modules on DreamHost

Apache .htaccess Directives and Loaded Modules allowed on DreamHost Apache Server 2 Setups.

Continue...


View Detailed HTTP Headers

HTTP Headers

HTTP Header Name
Header Description
Example HTTP Header

Accept
Content-Types that are acceptable
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Charset
Character sets that are acceptable
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Accept-Encoding
Acceptable encodings
Accept-Encoding: gzip,deflate

Accept-Language
Acceptable languages for response
Accept-Language: en-us,en

Accept-Ranges
What partial content range types this server supports
Accept-Ranges: bytes

Age
The age the object has been in a proxy cache in seconds
Age: 7200

Allow
Valid actions for a specified resource. To be used for a 405 Method not allowed
Allow: GET,HEAD,POST,OPTIONS,TRACE

Authorization
Authentication credentials for HTTP authentication
Authorization: Basic UXNrYXBhggRfoopc5NteWFzcw==

Cache-Control
Controls how proxies may cache this object
Cache-Control: max-age=7200, public

Connection
What type of connection the user-agent would prefer
Connection: Keep-Alive

Content-Encoding
The type of encoding used on the data
Content-Encoding: gzip

Content-Language
The language the content is in
Content-Language: en-us

Content-Length
The length of the content in bytes
Content-Length: 5356

Content-Location
An alternate location for the returned data
Content-Location: /index.html

Content-MD5
An MD5 sum of the content of the response
Content-MD5: 1167b9c13ad2b6d3694493fc47976c8

Content-Range
Where in a full body message this partial message belongs
Content-Range: bytes 110-2034/2035

Content-Type
The mime type of this content
Content-Type: text/html; charset=UTF-8

Date
The date and time that the message was sent
Date: Sat, 05 Jan 2008 09:27:35 GMT

Host
The domain name of the server (for virtual hosting)
Host: www.askapache.com

If-Modified-Since
Allows a 304 Not Modified to be returned
If-Modified-Since: Sat, 05 Jan 2007 09:26:12 GMT

Last-Modified
The last modified date for the requested object
Last-Modified: Sat, 05 Jan 2008 09:26:12 GMT

Location
Used in redirection
Location: http://www.askapache.com/

Server
A name for the server
Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2

User-Agent
The user agent string of the user agent
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

List of HTTP Response Status Codes
1xx Info / Informational
HTTP_INFO – Request received, continuing process.
Indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.

100 Continue – HTTP_CONTINUE
101 Switching Protocols – HTTP_SWITCHING_PROTOCOLS
102 Processing – HTTP_PROCESSING

2xx Success / OK
HTTP_SUCCESS – The action was successfully received, understood, and accepted.
Indicates that the client’s request was successfully received, understood, and accepted.

200 OK – HTTP_OK
201 Created – HTTP_CREATED
202 Accepted – HTTP_ACCEPTED
203 Non-Authoritative Information – HTTP_NON_AUTHORITATIVE
204 No Content – HTTP_NO_CONTENT
205 Reset Content – HTTP_RESET_CONTENT
206 Partial…

4 Comments | Continue...


Speed Tips: Use Multiple SubDomains

To make your site even faster, serve certain content from different subdomains. The reason this works is amazingly cool!

20 Comments | Continue...


Speed Up Google Analytics with urchin.js

Update: This article is a bit dated, to get the newest and latest Google Analytics Speed Tips, check out the 3 part update about Hosting, Cookie Domains, and JavaScript Loading and Failproofs

Ever notice that sometimes your sites take a while to load all the way because google’s urchin.js file is taking forever? You may recognize this problem when you see something similar to this in your browsers status bar “Transferring data from google-analytics.com…”

Time To Setup?
4 minutes I got tired of seeing that all the time and so I set up an automated cronjob that runs every 12 hours and downloads the latest version from google, and saves it to my website directory, then I reference /urchin.js instead of http://www.google-analytics.com/urchin.js.. and my site loads a lot faster!
Take a look at the source for this page if you want to see what is going on (look at the bottom)
There are 2 pretty major things that you accomplish by hosting urchin.js locally

You Enable persistant connections
You ensure that the correct 304 Not Modified header is sent back to your site visitors instead of reserving the entire file.

The urch.sh shell script
Create a shell script called urch.sh.. this will be executed every 1/day or 1/wk, whatever you want. The following script removes the local urchin.js, then it wgets the latests version into the local directory.
#!/bin/sh
rm /home/user/websites/askapache.com/z/j/urchin.js
cd /home/user/websites/askapache.com/z/j/
wget http://www.google-analytics.com/urchin.js
chmod 644 /home/user/websites/askapache.com/z/j/urchin.js
cd ${OLDPWD}
exit 0;
Improved shell script
I realized right away that a more modular shell script would be needed.. I admin like 50+ web-sites and it would be stupid to have to type the same block of code 50 times, wget the same file 50 times, etc.. So this version downloads the urchin.js file into a temporary directory, then it copies it OVER the old file for each directory. So 1 GET request…

Tagged: , | 11 Comments | Continue...


Speed Tips: Remove Last-Modified Header

If you remove the Last-Modified and ETag header, you will totally eliminate If-Modified-Since and If-None-Match requests and their 304 Not Modified Responses.

Tagged: , , , , , | 6 Comments | Continue...


Speed Tips: Turn Off ETags

ETags OffBy removing the ETag header, you disable caches and browsers from being able to validate files, so they are forced to rely on your Cache-Control and Expires header.

Tagged: , , , , | 8 Comments | Continue...


Speed Tips: Add Future Expires Headers

With Expires HeaderA first-time visitor to your page will make several HTTP requests to download all your sites files, but using the Expires header you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views.

Tagged: , , , | 7 Comments | Continue...


Speed Tips: Turn On Compression

mod_deflate disabledUse the Apache module mod_deflate to compress your static .css and .js files, speeding your site up like crazy!

Tagged: , , , | 16 Comments | Continue...


Top methods for Faster, Speedier web sites

High Performance Web Site list of the best and newest methods to make web pages super fast using caching, compression, cache-control, etc.

1 Comment | Continue...


Apache Variable Fun in htaccess

Server and Environment Variables are used by The Apache HTTP Server by provides a mechanism for storing information. This information can be used to control various operations such as logging or access control.

3 Comments | Continue...


htaccess HTTPS / SSL Tips, Tricks, and Hacks

Apache has the best SSL/HTTPS support and can be controlled by the httpd.conf file or other HTTPD server configuration file. This htaccess tutorial has htaccess example code to make it easy to secure and use HTTPS and SSL with Apache.

1 Comment | Continue...


Security with Apache htaccess Tutorial

Apache Security tips and tricks for securing Apache Web Servers using htaccess, httpd.conf, and other built-in techniques to thwart attackers. This really should be required reading for any Apache admin or user because these little tricks are so easy to do.

Tagged: , , , | 2 Comments | Continue...


Apache Authentication in htaccess

How to password-protect, Allow or Deny a visitor based on a condition. If you are having trouble getting htaccess-based password protection to work see: Troubleshooting htaccess Authentication: Getting it to work


10 Comments | Continue...


Speed up your site with Caching and cache-control

Caching with .htaccess and Apache will take your website and your web skills to the next level. This is some technical and advanced methods condensed to simple htaccess code examples for you.

5 Comments | Continue...


SEO Redirects without mod_rewrite

Web Professionals use mod_rewrite to issue 301 and 302 Redirects for Search Engines. Sometimes you may not have mod_rewrite.c or you want an alternative redirect method. Using mod_alias RedirectMatch you can use REGEX in Redirect commands!

Tagged: , | 11 Comments | Continue...


PHP htaccess tips and tricks

Htaccess php tips and tricks for the Apache HTTPD Web Server, mostly these tips show you how to run customized versions with customized php.ini files, I require custom php.ini files because they are so useful!

1 Comment | Continue...


Manipulating HTTP Headers with htaccess

Apache .htaccess and httpd.conf have the power to send and manipulate HTTP Header Requests like sending P3P privacy headers, Content-Type: UTF-8, Content-Language, etc. The power is immense and you can do some really cool stuff with HTTP Headers!

13 Comments | Continue...


htaccess Tricks for Webmasters

Some of my favorite htaccess examples from some of my favorite .htaccess tutorials. These cut-and-paste ready htaccess code snippets are very useful for website and server administrators.

Tagged: , | 9 Comments | Continue...


htaccess rewrite, htaccess

Comprehensive .htaccess example file with advanced examples in 1 htaccess sample skeleton .htaccess file with the very best apache htaccess examples… Updated frequently based on detailed info from the Apache htaccess tutorial.

8 Comments | Continue...


Apache Web Server Speed Configuration Hacks

Apache server performance can be improved by adding additional hardware resources such as RAM, faster CPU, etc.

2 Comments | Continue...


HTTP Packet Capturing to debug Apache

This article is a quick and easy HowTo detailing the use of Wireshark or another network sniffing program to debug your Apache .htaccess or httpd.conf files.

1 Comment | Continue...


Caching Tutorial for Webmasters

If you examine the preferences dialog of any modern Web browser (like Internet Explorer, Safari or Mozilla), you’ll probably notice a ‘cache’ setting. This lets you set aside a section of your computer’s hard disk to store representations that you’ve seen, just for you. The browser cache works according to fairly simple rules. It will check to make sure that the representations are fresh, usually once a session (that is, the once in the current invocation of the browser).

1 Comment | Continue...




Youtube experiment.. just testing!.. 5 autostarting songs..
My Picks


The love of liberty is the love of others; the love of power is the love of ourselves.
-- William Hazlitt


Someone's Reading
Most Popular 100
Newest Posts
Tech Topics
Website Speed Tips Series
  1. Turn On Compression
  2. Add Future Expires Header
  3. Add Cache-Control Headers
  4. Turn Off ETags
  5. Remove Last-Modified Header
  6. Use Multiple SubDomains

Good Causes

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. Tim Berners-Lee



It's very simple - you read the protocol and write the code. -Bill Joy

HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C | TLDP | WAI | DISA | ICSI | GIAC | SANS RR | GHOST | DEFCON | NIST | DHS CYBER | NIST | Phrack | GDB | IEEE | GIT | GNU LIBC

↑ TOPExcept where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. HTTPD based on NCSA HTTPd

Site Map | Contact Webmaster | Email AskApache | Glossary | License and Disclaimer | Terms of Service