Archive for the 'HTML' Category

Flash loading and browser cache test-suite

Thursday, July 10th, 2008 by Thomas

As a little homage to our most popular and seemingly helpful blog post about the Nasty XML load bug in Internet Explorer I created an app that tests the caching behavior of the browser it’s running in.

To recap - Loading XML files in Flash over an SSL Connection in Internet Explorer fails if the “Pragma: no-cache” or “Cache-Control: no-cache” HTTP headers are set in the server’s response.
In AS2 the loading failed silently, in AS3 we at least get an IO Error #2032, which has been discussed several times (see below)

If you want to keep the browser from caching your dynamic content you’ll have to use other means.
Judging from my tests, the best headers to prevent caching without causing errors in IE are: “Cache-Control: no-store” and/or “Expires: Thu, 01 Jan 1970 01:00:00 GMT”.

You can access the test suite here:

Set the headers that you’d like the server-script to return and find out what happens when the same request is sent twice after each other.
Use the Live HTTP Headers Plugin for Firefox if you’d like to see what the server actually returns.

Other interesting insights

  • The problem still exists in Internet Explorer 7! Don’t know about Vista…
  • Here it’s suggested that “Cache-Control: must-revalidate” and “Cache-Control: max-age=0″ also work. While that’s true in the sense that they don’t cause an error IE, they don’t seem to prevent caching 100% - there is a timeout.
  • “Pragma: no-cache” causes the error in IE, but doesn’t actually prevent it from caching at all when it’s set on a non-ssh connection.
  • Firefox internally sets the expiry date of script files to the past - so unless you set the “Expires” header to the future it’ll never cache the content.
  • Safari and Firefox change their caching behavior when the “Last Modified” header is set. If it’s in the past they seem to be happy to cache the file for you.

PHP sessions

Note that in PHP, as soon as you use sessions with session_start() the no-cache headers are added automatically. You’ll have to replace those headers or turn the default behavior off in php.ini. To replace the headers (found in the comments of the original post, see also the session-cache-limiter function and comments):

session_cache_limiter(’public’);
session_start();
header (”Cache-Control: cache, must-revalidate”);
// or if you still want to prevent caching
header (”Cache-Control: no-store”);
header (”Pragma: public”);

Related links:

Toro Rosso

Tuesday, March 27th, 2007 by Torsten

The next Red Bull F1 team strikes back with a brand new website. Our intention was to involve the user in such a way that he is really feeling close to what is happening on the race track.


The relaunch shows the usual Less Rain tuning (friendly Search Engine Optimization (SEO) , Alternate HTML version optimized for ScreenReader, Back Button, Deeplinking).

Crazy chicken sound design by Taeji Sawai, straight from Japan.

Related entries:

Wii like music!

Friday, January 19th, 2007 by battin

wii tunes

So you want to stream to your music into your living room, but can’t afford a media-center? If you own a Nintendo Wii, here is the solution: DOT.TUNES is a server application which allows you to stream your music to any place connected to the internet. It works on every browser with Adobe Flash support, so you can connect via your pda, mobile phone, psp, wii etc.

If you are too stingy to buy a lincense for DOT.TUNES there is a free alternative aswell, called WiiAudio, which is in it’s beta stage right now. Happy listening!

Wii Browsing

Tuesday, January 16th, 2007 by Carsten Schneider

Yesterday I finally managed to get my Wii online and immediately installed Opera (after downloading R-Type). Quite a few websites get now Wii-friendly to work on the low resolution, with big chunky buttons and larger type.

Wiiflow for example has a collection of Flashgames, easily accessible - best of all, it has Zookeeper!

Finetunes is a music player specifically designed for the Wii, with a cover-flow-like interface.

And from Winksite you can download a WordPress plug-in to get your blog Wii-ready.

Ajax and bookmarking, refreshing and going back

Thursday, January 5th, 2006 by Matthias Willerich

It’s already a while ago, but I lost track of these crazy modern internet things for a bit: In October Eric Pascarello offered a weblog post and an article about how to use Ajax in an hit-refresh-safe kinda way.

Now, what I like about his approach is that it’s very clean and straight forward; a solid and easy to understand solution to a well defined problem. But the interaction problems between browsers and Ajax applications don’t stop here. Try hitting the back button, and you’ll be disappointed, be it IE or Firefox (as the two don’t work, I didn’t bother testing other browsers on it).

Luckily there’s help, in two ways: Either you take the framework route and choose the dojo toolkit. It’s a toolkit that deals with xmlhttprequest on one hand and the representation of state changes on the other, something that generally used to be called DHTML effects.

If you choose to build things yourself, because you consider it too heavy, or for a million other reasons, Mike Stenhouse has written up his approach on fixing refresh, back button and bookmarking over at Content with Style. While he takes pretty much the same approach as the Dojo toolkit (both came out around the same time), he took the time to explain his approach thoroughly, which has been discussed ever since. So, rather than including a bit of a heavyweight js-library in your code, you should be able to build it all yourself after reading his article. Like this, you can reduce the load to only the essential code that you need.

Oh, before you get all excited: None of the back-button solutions work in Safari, and I have yet to see an ajax-fixed-back-button solution for it, in any variation.

Update:
Here’s also a little bit more to read about the Dojo approach, and I also found an O’Reilly Article about the same thing all over again, but Brad Neuberg, the author, packed it all nicely into a library and an exhaustive article (which probably leaves no questions open, but I can’t read it right now, so you’ll have to find out for yourself).

Firefox 1.5 + JavaScript: onload and the new onpageshow event

Friday, December 2nd, 2005 by Thomas

The new “Back-Forward Cache” feature shipping with Firefox 1.5 might cause problems for pages dependant on the onload event.

Luckily this is well documented: Using Firefox 1.5 caching.

Basically you have to use the new event onpageshow on top of onload, as IE and earlier Firefox releases don’t fire onpageshow events. When loading a page “normally” (not-cached), both events are fired, onload first, onpageshow second.

A usefull feature, but I do think it will cause problems on some pages or at least parts of them, especially when HTML, Javascript and Flash are tied in together closely. In my case a Flash movie needed to be notified of the page-load, which it wasn’t anymore…

HTML: Search Engine Ranking Factors Overview

Monday, October 3rd, 2005 by Carsten Schneider

A list of factors that influence your page ranking in search engines, over at SEOmoz.org. Very comprehensive, everything listed by importance, and includes techniques you maybe didn’t know they get you banned.

Content with Style: It’s all about P3P

Thursday, September 22nd, 2005 by Matthias Willerich

Content with Style logo

CwS had a long summer’s sleep, and between servers going down and a general lack of content and lots of things to do, it wasn’t particularly helpful that I picked a subject that is described only half-heartedly or way too technical to simply take on board whereever I’d do my research.

Anyway, it’s there now, and it’s about the Platform for Privacy Preferences, a way to persuade IE with higher privacy settings to accept cookies. Go to Content with Style and read all about it! Oh, and feel free to leave your comments there…

HTML: a list apart relaunch

Wednesday, August 24th, 2005 by Matthias Willerich

one of my favourite best practice websites had a complete front-to-back relaunch. With a new design, new engine, and 3 new articles to start with.

Enjoy, Matthias

New WYSIWYG text editor for browsers

Friday, June 3rd, 2005 by Thomas

FCKeditor is a feature rich WYSIWYG text editor for browsers. It’s completely Javascript based, lightweight and the best thing: open-source.

Javascript: X Library

Wednesday, June 1st, 2005 by Luis

The X Library is a collection of reusable, cross-browser Javascript functions and objects. It contains core DHTML functions, utility functions, objects such as menus and tab panels, and also has some experimental stuff.

The state of PNG transparency

Thursday, May 26th, 2005 by Thomas

What is PNG? What browsers support the format? I thought IE didn’t have PNG support? Is it transparent or not? How can I make IE display PNG’s full transparency capabilities? These are all valid questions that arise when using the PNG format…

Read more