Posts Tagged web

HTTP’s 301 and 302

Just a little note, 301 is the HTTP code for “temporarly moved”, 302 is “permanently moved”.
Seems 302 is genereally more usefull and works better.
From what I noticed (I’m not sure about it), 302 has better SEO. Also some browsers seems to make better cache use with 302 and generating less requests on your webserver.


Leave a Comment

ipv6 urls

URLs are written like this: protocol://host-or-address:port/path-or-function

What happens with ipv6 is that addresses contains colons (“:”) , so how do you specify the port number in your web browser ? The same happens when you do an scp: you usually do scp user@host:path/to/file /local/path, how can you differenciate the host part and the path which are also seperated with a colon ?

The answer is: USE BRACKETS !
an ipv6 url can be written like this:

Also, a scp command with ipv6 addresses can be like this:

  • scp user@[fe80::abcd:abcd:abcd:abcd]:/etc/resolv.conf /tmp

I hope it’s usefull !

Leave a Comment

Crossover Chromium: google’s chrome browser for osx and linux

Codeweavers, the company which is famous for releasing Crossover (a kind of windows emulator for linux and osx, based on the famous wine project) have released crossover chromium which is a package that contains just enough of crossover and a build of chromium to be able to run it. There’s an OSX and a Linux build. Chromium is google’s project which is the base of the chrome browser. Crossover released the packages 11 days after google chrome got out, this is a proof of concept, wine and crossover have became mature, codeweavers are reactive, but becarefull, it’s not advised to use crossover chromium as day to day browser for now (anyway, I think I’ll try to do it !).

Get the OSX package here, and ubuntu 32 bit pacakge here, and Have Fun !

Update: on osx, my chromium keeps crashing, I think this might because of my firewall, on linux, the windowing is quite slow but for me it works.

Leave a Comment

web based bind zone generator

There a some web based bind zone generator, but searching for “zone generator” in google, I found a lot that aren’t working, refining my research didn’t helped me. I finally found one that does the stuff. It’s not optimal , but it work , and it’s there
Please, if you know of a better one, just let me know !

Comments (1)

My 4 varnish tips

Varnish is a reverse proxy, If you don’t know varnish, this article is not interesting to you 😉 .

This is my 4 little tips that greatly optimizes the efficiency of the caching politics:

Removing tracking, this generates a single cache entry for different urls that generates the same content (I use “gclid” as a tracking argument, this is what google uses), use this as the hashing algorithm:

sub vcl_hash {
  vcl.hash += regsub(req.url, ”\?gclid.*”, ””);

Then we can normalize compression (different browser uses different string for the “Accept-Encoding” header). Add the following in sub vcl_recv:

if (req.http.Accept-Encoding){
 if (req.http.Accept-Encoding ~ "gzip"){
  set req.http.Accept-Encoding = "gzip";
 }elsif (req.http.Accept-Encoding ~ "deflate" ) {
  set req.http.Accept-Encoding = "deflate";
  remove req.http.Accept-Encoding;

When a cookie is generated all subsequent request for any object uses that cookie, we shall remove the cookie for all static content
In sub vcl_recv add this:

if (req.url ~ "\.(js|css|jpg|png|gif|mp3|swf|flv|xml|html|ico)$"){
 remove req.http.cookie;

Be carefull with files with these extensions that generates dynamic content (png, jpg, gif file for captcha, html with rewrite  to php or aspx …)

To track client ip address in the log of your web server (the real one, the backend), in sub vcl_recv add this:

remove req.http.X-Forwarded-For;
set req.http.X-Forwarded-For=client.ip;

Then you can log the “X-Forwarded-For” header in your log (doing this depends on your webserver, I do that on apache and lighttpd).

Leave a Comment