Open GoogleCodeExporter opened 9 years ago
Thanks for the thoughtful analysis. I think what you are looking for to get
domain-mapping on unrewritten resources is the filter 'rewrite_domains'. Hope
that solves that aspect of the problem:
https://developers.google.com/speed/docs/mod_pagespeed/filter-domain-rewrite
We definitely want to get to the bottom of the situation where (say) unchanged
css files that are loaded-from-file are served unoptimized after they were
previously served optimized. Does this also occur with js/images or only css?
css is more complex because it's got optimizable images nested inside.
One potential explanation is that you have load-from-file on CSS files but are
using http-fetching to get the images embedded in the CSS files, and if those
have expired (no expires/cache-control headers imply 5 minute TTL) then that
might explain the behavior you see.
Original comment by jmara...@google.com
on 28 Oct 2012 at 12:08
Helpful suggestion. I've done some further 'playing around'. The scenario I
outlined above was intended to be hypothetical for illustration, but obviously
corresponds closely to our situation - but not exactly. In particular, we have
two sources for images: images related to the site's actual content (stored in
AWS S3) and those related to the site interface (site background, button
decorations, that sort of thing - stored on each web-server) - which are served
by the *same domain*. Specifically, CloudFront allows configuring path
patterns to map to different origins from the same CDN domain.
So, I modified the setup in light of your suggestion about images being
referenced from CSS. To simplify, I've used a separate CDN domain which maps
paths 1-1 to the site origin web-servers. I've set the load-from-file to
specify the entire site from the root - so that that it should apply to all
CSS/JS and Images referenced from CSS and generally through the site's domain
(The 'content' images are still served from the previous CDN domain with S3
origin, but the mod_pagespeed isn't setup to rewrite that domain at all -
keeping them independent).
Result: That did bring consistency to what is being re-written (or not) from
request-to-request (after the initial request with empty cache). By enabling
domain_rewrite as you suggest, that also ensures that all resources are using
CDN URLs, hence eliminating the problem I described. While all the CSS files
are now being served from CDN paths with *.pagespeed.<hash>.css names, none of
them are being combined - which is presumably a separate cause/issue.
So, strictly, the feature suggestion of a ModPagespeedMapRewriteFailedDomain
directive isn't necessary, though something like it would give more flexibility.
It would also be immensely helpful if the ModPagespeedMapOriginDomain and
ModPagespeedMapRewriteDomain would allow specifying the request domain (e.g.
HOST header value) or perhaps a wildcard *. (If you think that is a reasonable
feature request I'll open a new ticket for that).
Thanks for your help. You can close this request out.
(now I need to figure out why my CSS files aren't being combined).
Original comment by da...@foremosttravel.com
on 30 Oct 2012 at 5:24
Original comment by jmara...@google.com
on 26 Nov 2012 at 8:06
> It would also be immensely helpful if the ModPagespeedMapOriginDomain and
ModPagespeedMapRewriteDomain would allow specifying the request domain (e.g.
HOST header value) or perhaps a wildcard *.
MapOriginDomain accepts a HOST header argument, new in 1.8:
https://developers.google.com/speed/pagespeed/module/domains#mapping_origin
What would specifying a HOST header for MapRewriteDomain give us?
Original comment by jefftk@google.com
on 23 Jun 2014 at 7:11
Original issue reported on code.google.com by
da...@foremosttravel.com
on 28 Oct 2012 at 1:39