[TYPO3-dev] Using CDN with Typo3

Dmitry Dulepov dmitry at typo3.org
Mon Dec 29 14:09:54 CET 2008


Hi!

John Angel wrote:
> Regular expressions are slow - is this the only way? I suppose str_replace of "img src=\"typo3temp" is not safe enough?

ereg* is slow, preg_* is much faster. Your example above does not take config.absRefprefix into account. TYPO3 can be configured to add absRefPrefix to the typo3temp/ directory too. So I would either use a regular expression or two str_replace() calls. If you use str_replace, you will need to consider domains too because page can have several domains.

-- 
Dmitry Dulepov
TYPO3 core team
In the blog: http://typo3bloke.net/post-details/how_will_i_fix_bugs_in_extensions_from_now_on/
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book




More information about the TYPO3-dev mailing list