Using Cloudfront To Mirror Symfony2 Assets

No need to dump your assets on S3 for easy caching!

instead of trying to dump assets in S3 - hard (links) - problems (links)

dump them on your server so they will be available throught URLs like this:

but in your

# config.yml
# config_dev.yml
    assets_base_urls: ~

so the HTML generated by twig will be

then create a new CloudFront distribution with origin that would be something like and create the CNAME ->

As assetic uses Symfony2's asset system, it will work for them as well. You will get something like

<link rel="stylesheet" href="" />
Quentin Pleplé
May 2014