• Hi,

    I’m using WP 3.5.1 and w3 total cache 0.9.2.11.

    I have a CDN (Amazon S3) enabled and configured.

    I load post featured image using wp_get_attachment_url.

    This post is loaded two ways:

    1. As a single post (using standard template). wp_get_attachment_url returns CDN URL.

    2. As an AJAX request response (using WP API for AJAX, wp_ajax_ actions). wp_get_attachment_url returns non CDN URL.

    It looks like using WordPress AJAX is not loading CDN functionality.

    Can I load W3 TOTAL CACHE manually in AJAX function? Any ideas how can I get CDN URL in AJAX response?

    https://www.ads-software.com/extend/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Frederick Townes

    (@fredericktownes)

    W3TC does not hook into any filters and do replaces for CDNs etc. It replaces when the text is output into HTML. Also does not do replaces in when WP_ADMIN defined as true and WP AJAX requests are handled with WP_ADMIN set to true.

    Thank you Frederick.

    I fixed this by replacing urls via PHP str_replace function.

    Can I use this plugin’s functions to sort this problem out? If so, what functions should I use? I was playing around with creating new W3_Cdn object but without success.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘W3 Total Cache and AJAX’ is closed to new replies.