Running a PHP web application with static content distributed with IPFS

I was wondering whether this idea I’ve had in mind for a while now is implementable.

Say I’m running a PHP web application on my server, take Nextcloud as an example. Say this web app has a lot of static content like CSS, JS and images such as logos etc. that are sent to the clients when they use the website. I know IPFS can be used to distribute only static content, I’ve read about it on other threads in this forum. I was wondering whether it’d be possible to somehow add to IPFS and to IPNS only the strictly static and public content and configure the web server to send a X-ipfs-path header for every such file in the web-root.

This could be so awesome, especially for Nextcloud since many people install this web app on their home servers and thanks to IPFS’ duplication removal mechanism, every Nextcloud user with IPFS-comapnion installed can benefit from very fast loading speeds of their Nextcloud app.