futtta's blog

Frank Goossens' Twitterless twaddle

Archive for the ‘General’ category

Speed up your (WordPress-)site!

with 3 comments

Google likes fast! Visitors like fast! So why don’t you go make your site really fast?

Suppose you just bought yourself hosting and you just installed WordPress for blogging or lightweight-CMS-purposes, how can you improve your site’s performance in that case? Easy!

  1. speed up PHP: use a caching optimizer (I use APC) to significantly speed up PHP performance (don’t bother  signing up for shared hosting with a company that doesn’t offer PHP with acceleration).
  2. cache dynamic output: install the “WP Super Cache” WordPress plugin. Configure and then forget about it; if you create/edit a blogpost, impacted pages are automatically removed from cache.
  3. optimize CSS and JS: install the “CSS JS booster” WordPress plugin, which (amongst other things) grabs all CSS and JS from WordPress and Plugins and outputs it in one CSS- and one JS-file (some plugins, e.g. Sociable and WordPress Mobile Pack, might need tweaking of the css media-attribute though)
  4. avoid calling 3rd party javascript: tracking (e.g. Google Analytics, which I removed), widgets (e.g. Twitter badges) or other 3rd party gadgets (e.g. AddToAny, which I removed) can slow down your site’s performance significantly
  5. optimize images: fire up your favorite photo editor and make that image just a bit smaller, use an acceptable level of compression (I end up between 70 and 80% for JPEG’s, depending on the image) and upload to smushit.com to squeeze out the last optimization-drop (example; I used a 20KB picture from Flickr, resized it to 80%, saved it with 77% compression and smushed it to end up with a mere 6KB).

The impact of a number of these steps can be measured easily; below are the response times of my blog’s homepage (the  html including css, js and images) as measured by Pingdom Tool’s Full Page Test.

  1. default Wordpress (on a Linux VPS with 320Mb RAM memory): 6.5 seconds
  2. (1)  with PHP APC activated: 4.1 seconds
  3. (2) with WP Super Cache: 3.1 seconds
  4. (3) with CSS JS Booster: 1.3 seconds

So there you have it, from 6.5 to 1.3 seconds in only 5 easy steps! WordPress specific, but easily applicable to other platforms as well. Now go and make your site fast! And then go and make it even faster!

Written by frank

March 11th, 2010 at 9:58 pm

Fix iframe-positioning problem with frameMagic.js

without comments

A short followup on my previous post about iframes; as I happen to like simple drop-in solutions, I updated the javascript that handles the ‘blank 2nd page in an iframe bug’ to automagically work upon inclusion in the html.

So if you happen to have problems with the positioning of 2nd (or later) pages in iframes (due to the top part of the iframe not being visible in the ‘viewport’), just upload frameMagic.js to your webserver and add the following to the head of your html to ease your iframe-blues;

<script type="text/javascript" src="path/to/frameMagic.js"></script>

Optionally you can specify which iframes are to be treated this way (excluding the other ones) by doing

<script type="text/javascript">
var fM_conf="iFrame1,iFrame3";
</script>

You can find more information and examples on http://futtta.be/frameMagic.

Written by frank

March 9th, 2010 at 4:20 pm

Posted in Web development, lang:en

Tagged with , , ,

electro-jazz-folk: Bibio hartje Pentangle

without comments

Ge zou het misschien niet geloven, maar ik luister niet alleen naar Gilles Peterson. Akkoord, de man draait mooie plaatjes en toen ik in de aflevering van afgelopen zondag Ali Farka Touré hoorde, was ik weer totaal overtuigd van het genie van Mr. Brownswood. Maar ik mag niet zo overdrijven, mensen hebben dat niet graag, zo van die blinde idolatrie.

Dus nee, deze blogpost gaat echt niet over Gilles Peterson. Als ik niet in een eindeloze loop naar GP’s Worldwide luister, stem ik dikwijls af op KCRW, een radiostation uit California, USA. En wat ik daar hoorde heeft me blij gemaakt;

Bovenstaand YouTubeken is “Ambivalence Avenue” van Bibio (zie ook z’n myspace pagina), artiestennaam van de Brit Stephen Wilkinson, die iets geloofwaardig met electro en folk doet. Ge moet maar eens rondsnuisteren op YouTube, hij heeft zo nog leuke melodietjes.

Het zal wel iets met het grondwater of met Stonehenge te maken hebben, maar Bibio’s vernieuwingsdrang is niet nieuw. Eind jaren ‘60 begin jaren ‘70 bijvoorbeeld, deden Terry Cox, Bert Jansch, Jacqui McShee, John Renbourn en Danny Thompson samen prachtige dingen met jazz, folk en blues. En nu ik zo geheel toevalligerwijze aan Pentangle (want zo heette hun groep) heb, ben ik ervan overtuigd; Bibio is ook een fan en onderstaande “Light Flight” heeft hem diep geraakt;

Written by frank

March 5th, 2010 at 7:33 am

Posted in Muziek, lang:nl, tubeken

Tagged with , , ,

5 tips to tackle the problem with iframes

with 2 comments

Iframes have always been frowned upon by web-purists (confession: myself included). But things are never black and white and sometimes iframes can be the best solution for a problem (you could substitute “‘iframes” with “Flash” in the previous 2 sentences, but that’s another discussion). So here are 5 quick tips which might lessen some of the SEO- and usability-problems associated with the use of iframes;

1. Google loves doesn’t hate iframes done right!

Although Google is rather vague about the subject, iframes and SEO do not have to be mutually exclusive. But you will have to make sure it’s your main page that shines in search results, not the iframe-content. The main page (where the iframes are defined) has to be more then a mere placeholder for one or more iframes. Migrate as much information (titles, description and other text) from the iframe-content to your main page, which should describe what goes on in the iframe(s). Use the iframe title-property and insert alternative content between opening and closing iframe-tags. A quick example:

<h2>Calculate your mortgage rate</h2>
<p>Calculating your mortgage rate was never easier; just enter the loan-amount and the duration below!</p>
<iframe src=”http://page.url/iframe-container-page1″ …  title=”Calculate your mortgage rate here”>Your browser does not seem to handle frames properly, but you can calculate your mortgage rate <a href=”http://page.url/iframe-container-page1″>here</a></iframe>

2. Own the stage

Avoid visitors viewing the iframe-content out of the context of the main page (e.g. because they followed a link in search-results). Add javascript to the iframe-content to check if it is accessed stand-alone and redirect to the main page (or explain and provide link to the main page) if that is the case.

if(self.location==top.location) top.location.replace('http://contain.er/page-url/here');

3. Don’t draw blanks

When a visitor clicks a link at the bottom of a long page inside an iframe and the target is a shorter page inside the same iframe, then he/she will see a blank page which is … well not very usable, no? The (hackety-hack) solution; tell the browser to scroll to the top of the iframe each time a new page in it is loaded, by calling the function below (with the iframe id as parameter) when the iframe’s onLoad event fires:

<script>
var firstrun = new Object();
function frameMagic(el) {
if (typeof firstrun[el] === ‘undefined’) { firstrun[el]=true; }
else { document.getElementById(el).scrollIntoView(); }
}
</script>
<iframe id=”iframe” onLoad=”frameMagic(‘iframe’);”>

4. Your users really do need scrolling=”auto”!

Help your visitors access all iframe content no matter what configuration they’re using: don’t disable the iframe scrollbars! Disabling them will render the iframe partially inaccessible for some of your users, because the size your iframe-content needs depends on things outside your control such as operating system & versions (e.g. font & screen resolution), browser (e.g. css-implementation) and browser configuration (e.g. non-default font-size). Instead define a reasonable iframe-width and height, make the iframe-content width flexible (fluid) and let the browser decide if a vertical scrollbar is needed.

5. Smart sizing without scrollbars

If you really really really don’t want scrollbars, if you want your iframe to adapt to the size needed by the iframe-content automatically and if you’re not afraid to experiment; there are some nifty javascript-solutions that allow the iframe-content to communicate the required height to the main page. Check out Framemanager (stand-alone, has some issues though) and the JQuery-postmessage iframe-example (which does everything in javascript, which isn’t really ideal from an accessibility point of view).

Conclusion: iframes aren’t necessarily evil (either), but you’ll have to make a small effort to render them somewhat SEO- and user-friendly.

Written by frank

March 3rd, 2010 at 3:53 pm

Posted in Web development, browsers, howto, lang:en

Tagged with , , , ,

Hollandse trauma’s

with 4 comments

Ik ben een Hollander. Daar, nu weet ge het allemaal; Getuige van Jehova, gewetensbezwaarde en nu ook nog Hollander! Het is allemaal de fout van de vrouwen in m’n stamboom. Zowel m’n moeder als grootmoeder langs vaders kant kwamen van over de grens, uit gehuchtjes in Zeeuws-Vlaanderen. Zeeuws-Vlaanderen, alsof dat iets zou goedmaken. Niet dus, zeker niet voor de klasgenootjes in de Gemeentelijke Lagere School Blaasveld (Willebroek). Want ook al was m’n vader Belg en hadden zowel m’n moeder als m’n grootmoeder de nationaliteit verworven door met zo’n domme Belg te trouwen, dan nog vonden die speelplaats-treiteraars dat ik een Hollander was. Ik had het vuile plaatselijke dialect immers niet onder de knie en sprak iets wat toen nog ABN heette en dat hen ongetwijfeld als “Algemeen Bekakt Nederlands” in de oren klonk. Dus ik was een vuile Hollander.

Dat alles om maar te zeggen dat ik recht van spreken heb, als het over Hollandse taalgevoeligheden gaat. Want ik heb me gisteren ongelofelijk zitten ergeren. M’n vrouw heeft me verplicht om “De eenzaamheid van de priemgetallen” van Paolo Giordano te lezen. Aangezien Paolo een Italiaan is, heeft hij die titel niet zelf in het het Nederlands gezet. Nee, Mieke Geuzebroek en Pietha De Voogd hebben dat voor hem vertaald, daarin aangemoedigd door het (Nederlands) Fonds voor de Letteren.  En Mieke en Pietha, dat zijn dus Hollandse meiden. Echte Nederlanders, geen drie-kwartjes zoals ik. Dat leid ik alleszins af uit hun bijwijlen tenenkrullende vertaling. Want Mieke en Pietha; als Alice “in haar broek poept” en een pagina later “de gore derrie naar beneden voelt lopen”, dan knapt er iets in mijn getraumatiseerd taalgevoel-orgaan. Poepen is lekker, derrie bestaat niet en Goor is een voetballer of wielrenner, ik wil ervan af zijn. En als Mattia naar een partijtje mag in hoofdstuk 2, gaat dat dan over D66 of de ChristenUnie?

Versta me niet verkeerd, het is een mooi boek -beetje dramatisch misschien- en de vertaling leest verder best wel vlot. Maar ik wou dat ik een Italiaan was, of tenminste voldoende Italiaans verstond om het origineel te lezen. Of dat ik dan toch een echte Hollander was, want dan zou ik ook niks gemerkt hebben?

Written by frank

February 26th, 2010 at 1:25 pm

Posted in boeken, lang:nl, rants & raves

Tagged with , , , , ,

Browser choice, vacuming & security for father-in-laws

without comments

Being “the computer guy” in the family might be a pain in the ass sometimes, but trying to help out users that are not tech savvy can be very revealing. Yesterday my father-in-law asked me to take a look at his computer, there was something about the browser that was not right. Turned out he let Google lure him into downloading Chrome and making it the default browser. What bothered him most about Chrome was the lack of menu’s (file|edit|…|help), while a lot of the us (the in-crowd) consider the minimal use of chrome a plus. Usability is not only about clean, simple UI’s, but also about not breaking novice users’ expectations of how your application looks and behaves.

Anyway, I showed him IE8 and Firefox 3.5 (both were installed as well) and he recognized Firefox as the browser he was most familiar with. So I uninstalled Chrome, hid IE8, upgraded him to FF 3.6 and also installed the “Vacuum Places improved” and NoScript add-ons.

Vacuum Places improved” cleans up the places sqlite database where Firefox stores bookmarks and history and which can become very big over time.  When tweaking the options (“hide icon” and “auto-vacuum every 20 browser starts”) it was a great way to invisibly tune browser performance, but it turns out Firefox 3.6 vacuums places.sqlite automatically (when  idle, every 1 to 2 months). So Pierre, if you ever read this; remind me to uninstall “Vacuum Places improved” next time! :)

NoScript is a whole other beast; it is a add-on for the security-conscious tech-head, which by default disables javascript, flash, java, … It’s a great add-on, but it is very disruptive and as such totally unfit for novice users. Unless you change the configuration off course, because modifying these options makes NoScript a must-have addon for both you and your grandma;

Although the first option specifically claims it is dangerous to do so, these changes render NoScript into an add-on that provides a lot of extra security (protecting against clickjacking, cross-site scripting and implementing support for x-frame-options and Strict Transport Security) without bothering users with new UI-elements containing incomprehensible questions, messages or options.

Because web security is not only about protecting against threats, but also about not breaking novice users’ expectations of how your secured browser (and the web) looks and behaves.

Written by frank

February 22nd, 2010 at 1:13 pm

Posted in browsers, lang:en, security

Tagged with , , ,

Ik ben een Radiohoofd

without comments

Ik zit godganse dagen op het internet en als er tussen computer en smartphone dan toch nog wat tijd voor media overblijft, pikken we selectief wat televisie-in-uitgesteld-relais mee. Dat was vroeger wel anders; ik verslond boeken, tijdschriften en kranten, kocht veel CD’s, ging regelmatig naar de cinema, schuimde festivals af … Maar daar blijft weinig van over en ik mis dat allemaal wel, maar prioriteiten zijn prioriteiten en het is wat het is nietwaar?

Eén liefde is echter gebleven; radio! Ik en mijn radio, we go a long way back; als kind luisterden we met m’n ouders naar “Die tijd van toen” of “Te bed of niet te bed”. Toen ik 11 was, hoorde ik met een transistor-radiootje (dat ooit van mijn moeder was) Lutgart Simoens van onder m’n hoofdkussen. Als 14-jarige speurde ik in spanning de FM-band af tussen 100 en 104 Mhz, op zoek naar illegale vrije radio’s. Toen ik 17 was hoopte ik zelf plaatjes te kunnen draaien bij een héél lokale radio, maar dat is er nooit van gekomen. En later, als twintiger, kocht ik een wereldontvanger om naar Spaanse of Marokkaanse  staatsradio te kunnen luisteren, of naar een verdwaalde Amerikaanse conservatieve talk-radio en als dertiger schuimde ik het internet af op zoek naar online radio, kicken op dat middengolf-gevoel van 16kbit/s streaming in Realplayer.

Nu, als veertiger, download ik podcasts, luister ik in uitgesteld relais naar Gilles Petersons WorldWide op StuBru, stem ik in WinAmp af op KCRW music, ga -afhankelijk van m’n stemming- slapen met “Jazz” op Klara of  “Select” op StuBru. En soms, als ik ’s nachts niet kan slapen, dan gaat de lamp van de nachtradio nog eens branden en dan val ik in slaap met muziek van Neil Young, Tom Robinson (“Listen to the radio” vanzelfsprekend) of onlangs nog met deze vergeten parel van 10000 Maniacs;

Nee, hand-gekozen kwaliteitsmuziek van samenstellers en presentatoren met een passie voor de plaatjes die ze draaien, daar kunnen last.fm, Pandora of Spotify wat mij betreft echt niet mee concurreren. Ik ben immers een Radiohoofd.

Written by frank

February 18th, 2010 at 9:06 pm

Posted in Futtta-land, Muziek, e-life, lang:nl, rants & raves, tubeken

Tagged with , , , , ,