CDN Support

Does anyone have documentation on how to setup a CDN for the cache images?

I have a pull zone setup for http://cdn.example.com but do not know where to tell Zenphoto that the path to image files are now http://cdn.example.com/cache/gallery/example.jpg

Comments

  • You really can't tell Zenphoto. It needs to be able to see if the cached version of an image exists because it will cause it to be cached if not. Zenphoto generally does not provide static content.
  • There is no CDN support in Zenphoto as of yet. If I'm correct, the changes that would be necessary to add CDN support would be:
    1. Add admin option for CDN domain entry
    2. If CDN domain is set, output all cache image URLs with CDN domain instead of origin domain
    Adding an admin option is easy, but I'm not sure how involved it would be to change the domain for all image links. I don't believe that the devs have a CDN at their disposal for testing, either.
  • I can give someone access to my CDN from maxcdn.com if they want to test/work on a plugin.

    CDN on a pull zone caches automatically once the request is made. So pointing your browser to cdn.example.com/image.jpg makes the CDN copy the example.com/image.jpg and serve it from the CDN for all other request.
  • acrylian Administrator, Developer
    Feel free to open a ticket. But I guess this will require a lot core changes and not just a plugin since Zenphoto is setup to have all on the same server. This will need extensive testing. That means if it is possible to do this reasonable at all which we would need to investigate as well first it will in any case earliest a feature of 1.4.5 scheduled June 1st. And we have already other things on the list as well...
    I don't believe that the devs have a CDN at their disposal for testing, either.

    @kagutsuchi: No, we haven't. But I believe could basically test this with a subdomain like cdn.zenphoto.org as well? It is not exactly the same but a similar principle, isn't it?
  • PM when you are ready to use cdn.zenphoto.org I will setup my side but you will need to add a CNAME.

    I do not understand why this is a core problem. Why can a theme just call the images from cdn.example.com/image.png

    Is it not just a change from http://www.zenphoto.org/demo/albums/album2/Cosmos05.jpg
    to
    http://cdn.zenphoto.org/demo/albums/album2/Cosmos05.jpg

    On the http://www.zenphoto.org/demo/album2/Cosmos05.jpg.html page.

    Here is the dev guide with sample code from who I use. https://developer.netdna.com/docs/
  • acrylian Administrator, Developer
    It is a core problem because the image processor that generates all cached images like sized or thumb images needs to know about this as well. That comes before the urls you mention.

    Also there must be a support for other item types like video or audio files. It is not that simple as you think as you are not familiar with the Zenphoto internals. To do this all right will need major changes anywhere. My colleague will surely later tell more about that.

    We have no PM on our forum. In any case you need to open a ticket on the GitHub issue tracker. Otherwise we will not consider this. Again, before 1.4.5 nothing will be officially release in this regard anyway.
  • What we would consider is providing a "filter" that would allow a plugin to intercept the link generation and modify it as desired. It would be up to you to create the plugin that specifically handles CDN.

    But as acrylian has said, nothing will happen without an issue request that can be tracked.
Sign In or Register to comment.