CDN API Integration
Permalink
I'm trying to figure out the best way of integrating a CDN API into C5 to allow images/media files to be automatically available via CDN access.
1) How do you mark a file as you want it be serve via CDN? A file attribute would work for the file manager, and then the file object code could be modified to give the CDN url instead of the local path.
2) What about for .css / .js files? Should I simply do those manually, or can I take advantage of the helper functions which add scripts/css to the header?
3) What would the best way be to abstract something like this, so that your CDN choice could be easily added on. I'm thinking some sort of CDN registration and hook system? Any chance there's enough support in the community to warrant a core addition to support these hooks?
1) How do you mark a file as you want it be serve via CDN? A file attribute would work for the file manager, and then the file object code could be modified to give the CDN url instead of the local path.
2) What about for .css / .js files? Should I simply do those manually, or can I take advantage of the helper functions which add scripts/css to the header?
3) What would the best way be to abstract something like this, so that your CDN choice could be easily added on. I'm thinking some sort of CDN registration and hook system? Any chance there's enough support in the community to warrant a core addition to support these hooks?
Modifying your theme and header required is the easier way to go though, so YMMV.
This class is obviously by no means complete :)