Re: [Pharo-project] [Seaside] Zinc as static file server
On 12 May 2012, at 19:17, Paul DeBruicker wrote:
BTW, we (or I) definitively need to add If-Modified-Since and 304 Not Modified behavior to ZnZincStaticServerAdaptor.
OK. I added that to the version I just uploaded.
I'll have a look later on (I have little time this weekend). We also need at least one simple test (another one of Marcus' quotes; if there is no actively run test, it does not exist). We just need an extra version of #testIfModifiedSinceNotModified directly on a local server, it will require some setup, be it should be doable.
And I know that you know, but let me repeat that in production situations you definitively have to let apache or nginx serve the statis files, to take load of Seaside.
Yes definitely.
Your hack in ZnSeasideStaticServerAdaptorDelegate>>#handleRequest: lets Seaside first try and make an error before you consider static file serving, this almost defeats the purpose of not doing it by Seaside itself. Just a hunch, I haven't tested or benchmarked this.
Does Seaside have the ability to serve files from disk without loading them into a WAFileLibrary? I couldn't figure that out, or gave up before trying really. I edit all my CSS and JS in emacs and its a pain to reload after saving/committing. And for my use case the performance is fine.
Yes, your use case is perfectly valid. Sven
Paul, On 12 May 2012, at 23:59, Sven Van Caekenberghe wrote:
I'll have a look later on (I have little time this weekend).
We also need at least one simple test (another one of Marcus' quotes; if there is no actively run test, it does not exist). We just need an extra version of #testIfModifiedSinceNotModified directly on a local server, it will require some setup, be it should be doable.
I integrated your changes and added 3 tests: --- Name: Zinc-HTTP-SvenVanCaekenberghe.275 Author: SvenVanCaekenberghe Time: 14 May 2012, 10:59:51 am UUID: 94f2451b-b7e0-4d74-866b-d55b01c98ed9 Ancestors: Zinc-HTTP-PaulDeBruicker.274 refactored ZnStaticFileServerDelegate a bit: - store expiration times as seconds in #defaultMimeTypeExpiration & #mimeTypeExpiration map - add not only Cache-Control but Expires header as well - removed unused #responseForFile: fixed a bug in ZnMessage>>#clearEntity (didn't #close streaming entities with HEAD requests) --- Name: Zinc-Tests-SvenVanCaekenberghe.142 Author: SvenVanCaekenberghe Time: 14 May 2012, 11:11:41 am UUID: 9f8498a3-c576-4844-a0f5-bafc5c5cbeca Ancestors: Zinc-Tests-SvenVanCaekenberghe.141 added ZnStaticFileServerDelegateTests for - expiration - cache-control - if-modified-since, not-modified --- Have a look and tell me what you think. Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
participants (1)
-
Sven Van Caekenberghe