Unfortunately, this seems to be a bug in the Kentico CMS version 4.0. We are very sorry for this inconvenience. We will fix it in the nearest version.
In a meantime you can solve the issue by adding following lines into SetupControl() method in ~\WebParts\Viewers\randomdocument.ascx.cs file:
this.repElem.CacheMinutes = this.CacheMinutes;
this.repElem.CacheItemName = this.CacheItemName;