Code Design Internet Linux UNIX

Enable keep-alive in Apache

What is keep alive? Keep alive is a method to allow the same tcp connection for HTTP conversation instead of opening a new one with each new request. More simply put, it is a communication between the web server and the web browser that says “you can grab more than just one file at a time”. Keep […]

Code Internet Wordpress

Browser Caching via .htaccess

I added simple browser caching through my .htaccess file. vi .htaccess IMPORTANT: Add the following to the top of the file. ## EXPIRES CACHING ## ExpiresActive On ExpiresByType image/jpg “access 1 year” ExpiresByType image/jpeg “access 1 year” ExpiresByType image/gif “access 1 year” ExpiresByType image/png “access 1 year” ExpiresByType text/css “access 1 month” ExpiresByType text/html “access 1 month” […]

Code Internet

PHP Switch Statement – output result from selected option

I was asked to come up with a way to give users a list to choose from and output a result based on their selection. I decided to use PHP. I ended up using a Switch Statement to accomplish this task. I am not a PHP expert  but was happy to figure this out on […]


How much cache do you have?

No, I am not miss-spelling cash. I am talking about Web Cache. It’s a feature/service that you knowingly or unknowingly use on a daily basis. “A Web cache sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the […]


Mac Web Page Redirection

I posted how to redirect web pages for Windows and thought I’d show you how to do it on a Mac. You will need to edit /private/etc/hosts. $ ls -l /private/etc/hosts -rw-r–r– 1 root wheel 746 Oct 4 18:59 /private/etc/hosts $ cat /private/etc/hosts ## # Host Database # # localhost is used to configure the […]