A way to change image urls in post to cdn image url?

You can parse via regex for images in the_content; but is always load and slowly.
Maybe you change the url of images, after post_save in database or change the current posts inside the database and create an custom CDN. Its the fast way and all caching plugins has the break, that she must parse the content.
For background an custom CDN in WP see this answer.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)