Hi Howard - thanks for your reply.

Looks like an oversight.  I'm not familiar with CloudFront; can you
> give me a thumbnail overview of how your CDN hooks work?
>
> Sure.

Well Cloudfront is at heart a CDN.
It has many features, but how it works is that it delivers content from
edges that are close to end users.
If it don't have the content (or it is expired) it will proxy back to an
'origin' (there can be several) get the content, store it at the edge and
deliver to user.

It is a lazy CDN approach that works well as there is no need to first
upload content to a CDN - like S3.
http://aws.amazon.com/cloudfront/


How it works in the tapestry application is that we have configured a
cookieless domain against the CloudFront with the tapestry app as origin.
It all works great - apart from the stack assets where the
AssetPathConverter#convertAssetPath is never called.

*public class CDNAssetPathConverter implements AssetPathConverter {*
* private IParameter ip;*
* private String applicationVersion;*
*
*
*    public CDNAssetPathConverter(@Inject
@Symbol(SymbolConstants.APPLICATION_VERSION) String applicationVersion,*
*                    @Inject IParameter ip){*
*        this.applicationVersion = applicationVersion;*
*        this.ip = ip;*
*    }    *
*    String getCDNDomain() {*
*    return ip.getString(PKey.DOMAIN_CDN_VERSIONED, null);*
*    }    *
*    @Override*
*    public String convertAssetPath(String assetPath) {*
*    String domain = getCDNDomain();*
*    if(domain==null) return assetPath;*
*    *
*    String result = convertToCDN(assetPath, domain);*
*    return result;*
*    }*
*    private String convertToCDN(String path, String domain) {*
*        String _path = path.replaceFirst("^/+", "");*
*        return String.format("http://%s/%s";, domain, _path);*
*    }*
*    @Override*
*    public boolean isInvariant() {*
*        return false;*
*    }*
*} *

Reply via email to