[Seaside] Static resources location

Avi Bryant avi at beta4.com
Tue Nov 2 12:09:56 CET 2004


On Oct 30, 2004, at 4:03 PM, Kamil Kukura wrote:

>> An interesting trick that I was considering implementing for this is 
>> to set the Content-Location header of any CSS files to point to a 
>> configurable static base URL - this will then (I think) get used by 
>> the web browser when evaluating relative URLs within the stylesheet, 
>> and so you could keep your CSS clean of any interpolation like the 
>> above.
>
> And this would work also for text/html content? I mean in case of 
> <img> resources being used. Anyway, it sounds good.

We could use it for text/html as well, but that means that all the 
dynamic URLs have to be absolute - so you'd have to hardcode your 
hostname into the app configuration.  Not such a big deal, but it can 
be a minor hassle some times, for example if your local IP changes 
frequently.  Probably better would be to have some method on 
HtmlRenderer that looks up the same configuration data used to set 
Content-Location on CSS, and outputs absolute static URLs instead.

Avi



More information about the Seaside mailing list