The exception stack trace tells you exactly what's wrong: Line 231 of ApplicationFileCacheExample attempts to create a StringBuilder with enough capacity to hold the entire file, and the exception message says that you're out of memory.
So first of all, the thing you're trying to cache is not actually a text file. Then why is the class named TextFile? Secondly, if it's an HTML page, it won't actually contain the images. You have to cache multiple files. Cacheonix might have a cache available that is specialized for caching web pages.