MHT files taking a long time to display?
What is a MHT file?
MHT or MHTML, short for MIME HTML, is a web page archive format that is used to combine in a single document, the HTML code and companion resources that are otherwise represented by external links (such as images, Java applets and audio files). The content of an MHTML file is MIME encoded as if it were an HTML email message.
The MHT allows you to 'package up' all the resources of a web page into one file and easily save or transport it, without having to worry about all the resources.
How do I create a MHT file?
This is the easy part. Assuming you are using Internet Explorer...
- In your web browser, navigate to the web page you want to save
- Select File/Save as
- Select the file type of 'Web archive, single file *.mht'
- Choose the location and file name. Click Save
Why does my MHT file open very slowly?
My problem was that the MHT file opened quickly on the PC I had created it on, but very slowly on a second PC (it took more than five minutes).
The issue was caused by the anti-virus software on the creating PC. Kaspersky had inserted code that referenced a link that the second PC couldn't access through a corporate firewall. Internet Explorer entered a wait state, trying to access Kaspersky, which slowed the MHT display.
Here are two methods to fix this:
Temporarily turn-off Kaspersky protection on the creating PC, just while you are creating the MHT file. This will then create the MHT without the Kaspersky code.
- Open Kaspersky Internet Security
- Access Settings by clicking on the gear symbol in the bottom left corner of the main Kaspersky window
- In the Settings/General window, turn Kaspersky protection off using the switch in the top right corner
- Create your MHT file
- Remember to turn Kaspersky protection back on immediately
Remove the Kaspersky code in the MHT file.
- Open the MHT file in Notepad
- Search for Kaspersky
- Look for a section of code that looks something like this:
- Change the SCRPT tags to S_CRIPT and /S_CRIPT respectively.
- Your code should look something like this:
- Save the changed MHT file in Notepad
My technical config.:
- PC that created MHT file: Windows 8.1/Internet Explorer 11/Kaspersky Internet security 2016
- Second PC: Internet Explorer 11/McAfee anti-virus
I hope this helps you and thanks to my colleague Anthony Hamon for spotting this.