useCachedFile now operates urls and not elements

I apply caching to html snippets loaded remotely. Before injection to
DOM. This change allows me to prevent images from being loaded twice.