Archive for July, 2012

Your browser performance may be tricking you.

Tuesday, July 31st, 2012

Someone just came up to me and told me to load maps.nokia.com to see how fast it had got after our new server migration.

I opened up a new tab, typed the first few keys of the URL and bam the site was there - super fast! Wow! I check the network tab, 1.47seconds - amazing!

Then something strange happened, I cleared my cache and loaded the page again, no surprise, it took a bit longer without a primed cache. The strange part was when I reloaded again to get the super fast version. It was no longer super fast, it was a second or so slower than the un-primed version.

That’s weird, I thought.

I loaded again, no change. More weird.

I noticed that all the requests in the network tab had gone from being cached responses to 304’s so there was a server hit after all - but we have far future expires headers - this shouldn’t happen?

After some googling, I discovered my answer on stackoverflow.

When you use CTRL-R to reload a page, most browsers will send a 304 even to cached resources.

So as it turns out, the page was always caching resources and was always returning in 1.47 seconds, but ONLY if you reload the page by re-entering the url. Mystery solved.

Revisiting Conway’s Law

Monday, July 30th, 2012

I quoted Conway’s law, not so long ago on this blog:

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization’s communication structure.

But now I think about it, it doesn’t go deep enough, I would add this:

Further to this, any organization with a strong hierarchy (defined broadly) will usually have a communication structure that represents the mental state of the highest node of the hierarchy.

What this means very simply is, in a strong hierarchy, if you have a leader with strong silo-ing of the faculties of the brain, so someone who doesn’t balance well between creative and logic, then you will have a company that separates itself into Silo’s of creativity and logic. If you have a leader that does not learn, then the communication structure will represent that in-ability to not learn by never improving. Conversely if you have a leader that’s for example well organized, or has a strong sense of social justice, then the communication structure of the organisation will be well organized, with good channels from top to bottom to allow the flow of communication.

Command to remove files from svn older than 10 days.

Monday, July 23rd, 2012

This took some time to figure out so just wanted to share. Many thanks to Ben Barnard for providing final sounding board and Xargs wisdom.

find . -type f -mtime +10 | grep -v \.svn/ | sed 's/ /\\ /g' | xargs svn delete

Explanation:

find . -type f -mtime +10

This executes the find command, firstly on the current directory (.) then specifies type of file, in this case regular i.e. not symbolic link (-type f) then specifies the last modified time which is in 24 hour periods, in this case ten 24 hour periods - 10 days (-mtime +10).

grep -v \.svn/

Here the input is then piped into Grep, which removes any files with “.svn” in the path with the option (-v \.svn/).

 sed 's/ /\\ /g' 

Then, in our case we had spaces in some of the directory names, this broke the final SVN command, so we have to replace them using sed to be escaped.

xargs svn delete

Finally we pipe that output into xargs which calls svn delete with our cleaned up list and removes all files older than 10 days from svn. A final commit back to the repo and we are done.