Closed GoogleCodeExporter closed 9 years ago
So from a first look, this looks a little more complicated than it should be,
unless
I'm missing something obvious. The glow images work on local instances but 404
on
appspot urls. It's happening because the glow images are referenced in
main.css like
this:
background-image: url('/zx0000/images/glow-left.gif');
When the CSS files are included locally, this works fine. But when we're on a
deployed
instance and they're run through suprfetch, browsers think the images should be
rendered from the suprfetch domain, and not from our current one, so it's
trying to
find the background at http://www.gmodules.com/zx0000/images/glow-top.gif
instead of
http://footprint2009dev.appspot.com/zx0000/images/glow-top.gif. There are two
solutions that I see:
1. Add the full URL (http://www.allforgood.org/) to the start of all images and
other
URLs referenced in CSS files. This won't start working until we push the
latest
version to production, since the current version on allforgood.org doesn't
support the
/zx0000 links. That same issue will also come up whenever we deal with urls in
CSS
files in the future, but it shouldn't be a big deal because we'll be able to
test
properly on local machines (before adding allforgood.org to the URL).
2. Create a separate CSS file only containing rules with URLs, and include it.
This
would always work, but has the downside of adding some latency.
3. Is there a way with suprfetch force urls in CSS to load on the correct
domain?
Original comment by ehysen
on 9 Jun 2009 at 9:29
ah sweet thx for digging in!!!
suprfetch isn't (today) smart enough to rewrite URLs, but since it contains a
full CSS parser, this would be pretty easy to add. Modifying it seems like
the right solution.
reassigning to me, and also filing a bug in suprfetch:
http://code.google.com/p/suprfetch/issues/detail?id=3
while the UI design maybe changing, I'm going to assume that background images
will be present in either case, so I'm leaving as Critical
Original comment by adam.sah
on 9 Jun 2009 at 10:00
fixed in suprfetch: http://code.google.com/p/suprfetch/source/detail?r=28
Original comment by adam.sah
on 13 Jun 2009 at 6:17
Original comment by adam.sah
on 13 Jun 2009 at 6:34
Original issue reported on code.google.com by
adam.sah
on 9 Jun 2009 at 8:58