I think the problem is in your header call. Use the correct header call, as mention in this answer and everything should be fine:
header('HTTP/1.1 304 Not Modified');
Also remember that if you press F5 to refresh your page, probably your browser will ignore the cache and go straight to the webserver. To test, I'd add a link to the same page, or just click in the browser address bar and press enter.