Btw there are some bugs in the code:
1. ezhttp produce error if the variable you are getting is unset.
2. I hope this is only example code, since that cache block is a wast of resources (there is no point in caching two if's)
Is it a template for a view (full...) ? in that case, you have to disable the cache for this template (set ttl = 0 ) otherwise the node is cached, and it doesn't take into account the cache-block in the template.