This had me troubling for quite a while and looking on the Internet didn't really give any real solutions (here and here).
In my case the errors were caused by a custom Web Service that I added to SharePoint. When one of the Web Parts called the Web Service an event log entry was written:
Event Type: Error
Event Source: Office SharePoint Server
Event Category: Publishing Cache
Event ID: 5785
Unable to connect publishing custom string handler for output caching. IIS Instance Id is '238027762', Url is 'http://localhost/_myws/Service1.asmx'.
The solution is to modify the web.config of the Web Service application. Remove the PublishingHttpModule module that was added by the root web.config:
MOSS 2007 (because the problem relates to Publishing)