Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #51719
    Adam Luzsi
    Guest

    Dear Customer Service,

    I’m a WordPress developer and I would like to know if the W3 Total Cache (or any other plugins you have) are capable of the following:

    1. Serve images hosted on Akamai CDN
    2. Upload images directly to Akamai CDN instead of WordPress Media Library (i.e. the server).

    My current client has over 20 Terabytes of media (mostly images) hosted on Akamai CDN, and it’s crucial that whenever they upload an image it doesn’t get uploaded to the site’s hosting server, but directly to Akamai CDN.

    I really appreciate any help or suggestion regarding the above issue.

    Thank you in advance!

    Best regards,

    Adam Luzsi

    #51809
    Marko Vasiljevic
    Keymaster

    Hello Adam,

    Thank you for your questions and I am happy to assist you with this.
    W3 Total Cache does have integration with Akamai CDN and you can see that if you check the CDN dropdown under Performance>General Settings>CDN>CDN Type:
    To answer both of your questions, Yes W3 Total Cache will and can upload the images to the CDN, however, W3 Total Cache cannot upload the images directly to Akamai CDN without them being uploaded to the server first. What the W3 Total Cache CDN feature does is, uploads the images and use a URL rewrite to serve those images from the CDN instead of a server.
    Since this use case is not recommended this is out of the W3 Total Cache scope and to be honest, I’ve never seen a plugin that does that.

    I hope this answers your questions.

    Thanks!

    #51830
    Adam Luzsi
    Guest

    Hi Marko,

    Thanks for your answer and clarification, it absolutely helps!

    Let me discuss it with my client and get back to you.

    Thanks,

    Adam

    #52644
    Adam Luzsi
    Guest

    Hi Marko,

    This is a follow-up to my previous question and your reply.

    So I understand now how a CDN works, and my client has bought a premium subscription for W3 Total Cache and I enabled Akamai CDN in the settings, but it’s not clear for me how it actually works.

    The scenario is the following:

    Let’s say my client’s website domain name is example.com I have a staging/development website setup on my own hosting account which is example.stagedev.cloud, and I’ve added the premium licence key to this staging site for now to test.

    So I’ve uploaded an image (set as a featured image for a post) to the server, but on the front-end it gives me the WP uploads path and not the CDN path.

    What am I missing?
    Are there any other settings related to this?
    Is it maybe that Akamai is configured only for the example.com domain?

    Thank you very much,

    Adam

    #52662
    Marko Vasiljevic
    Keymaster

    Hello Adam,

    W3 Total Cache rewrites the URL using the Replace site’s hostname with a section in Performance>CDN.
    As you can see in the description, Enter the hostname provided by your CDN provider, this value will replace your site’s hostname in the HTML.
    SO instead of yourwebsite.come/wp-uploads/2022/05/someimage.jpeg, you will get the CDN URL for example akamai.yourwebsite.come/wp-uploads/2022/05/someimage.jpeg
    And to answer your question, yes you also need to set up a CDN for staging website as this is a different URL.

    I hope this helps!

    Thanks!

    #52669
    Adam Luzsi
    Guest

    Thanks for the answer Marko, it helps.

    Unfortunately the client says it’s not possible to create separate CDN for the staging, so I’m hoping maybe there’s a workaround?

    Also let me ask:
    1. what exactly do you put in the “Replace site’s hostname with” field? The full CDN domain name with the protocol? The actual CDN URL looks like this: https://cdn.yourwebsite.com/www/articles/

    2. Is it enough to fill in one “general” field in the “Replace site’s hostname with” section?

    3. Can you please give me the links to the detailed documentation regarding the CDN settings and the Total Cache Image Service settings?

    4. If W3TC doesn’t handle image resizing upon uploading a new image, can you please recommend any plugins that works best with W3TC? We want to limit image size, so as to prevent authors from uploading large images.

    Thanks for your help!

    #52728
    Marko Vasiljevic
    Keymaster

    Hello Adam,

    1. In the “Replace site’s hostname with” field, the CDN’s edge address should be added. This is used to rewrite the URL of the static resources as I’ve mentioned in the previous post.

    2. This should be added in the Performance>CND>Configuration: objects section.

    3. The CDN configuration depends on the CDN provider. You can always use Generic mirror and only add the CDN”s Edge address, or use Akamai from a CDN dropdown menu and configure the CDN with Username and Password.
    You can check this article for more details about Image Service.

    4. W3TC does not handle image resizing upon uploading a new image, so you can use some plugin for this.

    Thanks!

    #52781
    Adam Luzsi
    Guest

    Thank you very much for your help Marko!

    #52794
    Marko Vasiljevic
    Keymaster

    Hello Adam,

    You are most welcome!

    We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
    Thanks!

    #52798
    Adam Luzsi
    Guest

    Just posted a review! 🙂

    I just talked with the client and we have a couple more questions:

    So far we have found no way to be able to test the CDN, because it returns “Test failed” from both the staging domain and from my localhost where I set the live domain in my hosts file to point to localhost.

    Because of this we can just hope it will work once we go live, but since it’s a site with quite a lot of content it’s frustrating to have broken images everywhere…

    Our questions are:

    1. Do you have proper documentation on what each setting does on the Performance > CDN page?

    2. Does the plugin check whether the image is already present on the CDN, and if not it falls back to the physical version on the web hosting server? If not then is there a way to check this?

    3. Will the CDN cache get refreshed automatically if an image with the same filename gets reuploaded? (for example an author uploads the wrong image and replaces it, but the filename is the same) Or does the image have to be uploaded with a different filename?

    We appreciate your help Marko!

    #52850
    Marko Vasiljevic
    Keymaster

    Hello Adam,

    First of all, thank you for the awesome review.
    To answer your questions:

    1. We do not have documentation on every CDN setting since all settings are self-explanatory and of course, it depends on which CDN provider you are using and if you are using Pull or Push CDN Type. However thank you for the idea, as this might be a good article. I will add explanations below:

    Host attachments: when enabled, attachments (e.g. images from the media library) are served through the CDN.

    Host wp-includes/files: when it is active the files of the wp-includes folder are served through the CDN.

    Host theme files: when enabled the theme files are served through the CDN.

    Host minified CSS and JS files: when enabled, minified CSS and JavaScript files are served through the CDN.

    Host custom files: refers to the files specified in the Custom file list that you can see in the Advanced tab of this same page.

    Add canonical header: This allows you to identify the original URL with the canonical tag. Generally, search engines are able to distinguish the URL without the need to specify it, so by default, the option is disabled.

    Advanced

    Only purge CDN manually: by default W3TC manages autonomously the purge of the cache. If you enable this option you will purge the cache only manually, normally you don’t need to enable the function, as this was specifically added for Cloudfront users because of the huge invalidation costs on the AWS side

    Disable CDN on SSL pages: By activating this option you may run into the problem of mixed content. It happens when some contents are downloaded using HTTP protocol instead of HTTPS and the browser returns a not-secure site warning. In most cases, it is better to leave this option disabled.

    Disable CDN for the following roles: This allows you to choose which user roles to disable CDN for.

    2. Akamai CDN, as you can see is the origin pull, which means that the files are uploaded automatically to the CDN. Once uploaded, all images and files are served from the CDN. The CDN will not serve the image if it’s not uploaded to the CDN. In this case, the image will be served from the origin.

    3. It’s recommended to use different filenames for each image. So if the situation you described occurs, you should try purging the cache manually for the CDN in the W3TC settings. The problem with this is not the CDN, but the Browser Caching. For images, it’s recommended to use 1 year caching for browsers (Expires header and cache-control header) so if the image has the same filename and a different image is uploaded instead, the browser will think it’s the same image and will not fetch for the new one. It’s recommended to use the option “Prevent caching of objects after settings change” in Performance>Browser Cache. This option adds the random query string to files (You can enable it only for images) for example: ?xNNNNN. This will ensure that the browser always fetches the new file from the source, in your case CDN, and all you have to do us to update the media query string in Performance>Browser Cache (Just above the general section), once new image is uploaded with the same filename.

    I hope this answers your questions.

    Thanks!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘W3 Total Cache compatibility with Akamai CDN’ is closed to new replies.