Hi,
Just another question, my test site have some media (css & image).
I serve it with :
array('regex' => '#^/media/(.*)$#',
'view' => array('\photon\views\AssetDir', 'serve'),
'name' => 'website_assets',
'params' => __DIR__ . '/media',
),
I always have HTTP 200 Ok with file transfert, but never 304 not modified.
This is a static part of website, so it's will be interesting to use
the browser cache.
William
--
---------------------------------------------------------
William MARTIN
wysman @NoSpAm@ gmail @DoT@ com
Hello, > Just another question, my test site have some media (css & image). > I serve it with : > > array('regex' => '#^/media/(.*)$#', > 'view' => array('\photon\views\AssetDir', 'serve'), > 'name' => 'website_assets', > 'params' => __DIR__ . '/media', > ), > > I always have HTTP 200 Ok with file transfert, but never 304 not modified. > This is a static part of website, so it's will be interesting to use > the browser cache. As you may have seen, the AssetDir::serve view is very simple and does not handle the cache headers. This is a know issue. loïc -- Indefero - Project management and code hosting - http://www.indefero.net Photon - High Performance PHP Framework - http://photon-project.com Céondo Ltd - Web + Science = Fun - http://www.ceondo.com
Thanks for the reply, I will try to make a patch next week. William On Thu, Mar 17, 2011 at 6:10 PM, Loic d'Anterroches <loic@ceondo.com> wrote: > Hello, > >> Just another question, my test site have some media (css & image). >> I serve it with : >> >> array('regex' => '#^/media/(.*)$#', >> 'view' => array('\photon\views\AssetDir', 'serve'), >> 'name' => 'website_assets', >> 'params' => __DIR__ . '/media', >> ), >> >> I always have HTTP 200 Ok with file transfert, but never 304 not modified. >> This is a static part of website, so it's will be interesting to use >> the browser cache. > > As you may have seen, the AssetDir::serve view is very simple and does > not handle the cache headers. This is a know issue. > > loïc > > -- > Indefero - Project management and code hosting - http://www.indefero.net > Photon - High Performance PHP Framework - http://photon-project.com > Céondo Ltd - Web + Science = Fun - http://www.ceondo.com > -- --------------------------------------------------------- William MARTIN wysman @NoSpAm@ gmail @DoT@ com
Hello William,
You can also delegate the static resources to mongrel2:
hosts = [
Host(
name="localhost",
routes={
'/media/': Dir(base="your/real/www/media/",
index_file="index.html", default_ctype="text/plain"),
}
)
]
Mongrel2 serve files with support for 304 and ETag.
--
Mehdi Kabab
Développeur Web / Auteur
CV : http://mehdi.kabab.name/
Livre : http://gimp4you.eu.org/livre/
Code : http://pioupioum.fr/
Twitter: http://twitter.com/piouPiouM
2011/3/16 William MARTIN <wysman@gmail.com>
> Hi,
>
> Just another question, my test site have some media (css & image).
> I serve it with :
>
> array('regex' => '#^/media/(.*)$#',
> 'view' => array('\photon\views\AssetDir', 'serve'),
> 'name' => 'website_assets',
> 'params' => __DIR__ . '/media',
> ),
>
> I always have HTTP 200 Ok with file transfert, but never 304 not modified.
> This is a static part of website, so it's will be interesting to use
> the browser cache.
>
> William
>
> --
> ---------------------------------------------------------
> William MARTIN
> wysman @NoSpAm@ gmail @DoT@ com
>