Question

Enable cloudfront for wordpress and php app

Hello, we are about to launch a new product and need some help here. this is what we want to achieve.

our main site is on www.example.com which is a wordpress multi-site on sub-directory level. and we have a php app thats on app.example.com now we want to use aws cloudfront (custom origin) to serve static files(css, js & image) for both the site & application. also is there any way to set certain file types only? is it possible to have single distribution for both? if yes how can we do that? even if we need multiple distributions that ok but please give us some guidance here. i have read all the articles from aws but there are not that understandable for newbies like me.

i also want to say, we want to make this without any plugin if possible. because plugins not gonna cover our application and we are really trying to avoid any 3rd party plguin here if possible.

thanks in advance.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I’ve done a bit of digging and I wasn’t able to find any option to use CloudFront for particular types of files on WordPress without the use of a plugin. Since WordPress by default expects it’s assets to be on the same host and in particular folders a plugin is required to override this and serve them from a CDN. Another option might be a service like CloudFlare that would work without any custom WordPress settings and automatically cache content, thus improving performance and reducing bandwidth use.