- Install and configure a PHP opcode cacher like XCache;
- Edit the php.ini file and increase the maximum amount of memory a script may consume (memory_limit);
- Edit the php.ini file and increase the maximum execution time of each script (max_execution_time);
- Edit the config/tcpdf_config.php file: manually set the $_SERVER['DOCUMENT_ROOT'], K_PATH_MAIN and K_PATH_URL constants, and remove the automatic calculation part;
- If you are not using the Thai language, edit the config/tcpdf_config.php file and set the K_THAI_TOPCHARS constant to false;
- If you do not need extended chars, edit the config/tcpdf_config.php file and set the default fonts to core fonts;
- If you do not need UTF-8 Unicode, set the $unicode parameter on TCPDF constructor to false and the $encoding parameter to 'ISO-8859-1' or other character map.
- By default TCPDF enables font subsetting to reduce the size of embedded Unicode TTF fonts, this process, that is very slow and requires a lot of memory, can be turned off using setFontSubsetting(false) method;
- Use core fonts instead of embedded fonts whenever possible;
- Avoid using the HTML syntax (writeHTML and writeHTMLCell methods) if not strictly required;
- Split large HTML blocks in smaller pieces;
- Avoid using transactions if not strictly required;
- Restart the webserver after changes.