[Box-Admins] serving files from box4

Chris Cunnington websela at yahoo.com
Fri Mar 21 13:54:46 UTC 2014


On Mar 20, 2014, at 3:41 PM, Levente Uzonyi <leves at elte.hu> wrote:

> On Thu, 20 Mar 2014, Chris Cunnington wrote:
> 
>> locator at: (ALPath / 'favicon.ico')
>> 		put: (ALFileResource on: (FSLocator imageDirectory / 'squeakfavicon.ico') resolve)
>> 
>> This code is in the current squeak.org image for the favicon, which is a file in the imageDirectory. The simplest thing is for Altitude to be fed a path to wherever Levente wants to put the files for the homepage. The files currently served from my webpage could then be dropped into that directory. Then I can change the absolute references to my site to the disk from:
>> 
>> html footer: [ html img src: 'http://www.chriscunnington.com/poweredsqueak.png'].
>> 
>> to something like:
>> 
>> html footer: [ html img src: (ALPath / 'poweredbysqueak.png') ].
>> 
>> That is if the image will handle it's own files. If we are separating static and dynamic requests in nginx  for speed and such, then I think I need to change the links to something in Altitude like:
>> 
>> html footer: [ html img src: '/img/foo.jpg' ].
>> 
>> with a locator like:
>> 
>> locator at: (ALPath / 'img' / 'foo.jpg') put: (ALFileResource on: FSReference * 'img' / 'foo.jpg')
>> 
>> where nginx sees the token /img/ and sends the request to wherever the static files are served from.
> 
> The goal is to let nginx serve the static files, and let the browsers and proxies cache them forever.
> 
> I wanted to use a separate subdomain (or a set of subdomains) for the static files, but it's easier for now to use a path prefix with the following pattern:
> 
> /static/*/...
> 
> Where * is the version label - a sequence of alphanumeric characters, and ... is the actual path to the resource. For example for /img/foo.jpg the actual path is
> 
> /static/v1/img/foo.jpg
> 
> If there's a new version of the resource with the same name, then all you have to do is to replace v1 with v2, then v3, etc.
> 
> If you upload the static files to the server, then I'll configure nginx to serve them.

OK, that' sounds straightforward. I'll change the absolute links in Altitude that point to my site to the squeak.org domain and the paths you just described once you've made them available. Here are the files squeak.org uses. 

http://www.chriscunnington.com/squeak.org_files.zip

Chris 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/box-admins/attachments/20140321/6911a25a/attachment.htm


More information about the Box-Admins mailing list