Thanks, I replaced that code and it works now (I was just using a script I found on the web - I'm trying to get my head around 304 and this script included it).
Anyway, I've added in the 304 part and that loop is now entered on subsequent calls - which is what I want. Now I need to get it working for SVG, which will be fun...