Improved parsing of uncached tags and added resource reference for cached output

please see commits for changes.

works quiet well now :)