Re: [Zope-dev] [Checkins] SVN: zope.app.publisher/trunk/ To make browsers update their caches of resources immediately when the

2009-06-10 Thread Christian Zagrodnick
Hoi,

On 2009-06-09 15:51:03 +0200, Stephan Richter 
srich...@cosmos.phy.tufts.edu said:

 On Tuesday 09 June 2009, Wolfgang Schnerring wrote:
   To make browsers update their caches of resources immediately when the
   resource changes, the absolute URLs of resources can now be made to
 contain a hash of the resource's contents, so it will look like
   /++noop++12345/@@/myresource instead of /@@/myresource.
  
   - Implemented an AbsoluteURL adapter that computes a hash of the
 resource's contents and inserts that into the URL. - Content hashes will
 be
 cached in memory, except when in developer mode - Introduced a ++noop++
 traverser that simply throws away the path segment - Wrote a bit of
 documentation about resources
 
 Mmmh, this looks like a lot of extra code to get behavior that is served
 
 better with different tools. Have you looked at z3c.versionedresource and
 
 z3c.traverser? Both of those should solve these type of use cases well.

The checkin actually is two in one (which aruably is not such a good thing):

1. Make resources compute urls with an IAbsoluteURL adapter so they 
behave like every other object.

2. Provide an optional hashing adapter (and the ++noop++ namespace).

I don't think we have to argue about 1.

The ++noop++ and hashing could easily be moved to a different package. 
The idea behind the hasing is that one should not have to think about 
new versions or cache invalidations. That's also why in development 
mode the hash is computed every time and not just once: It aids 
development a lot. But it helps in deployment as well of course.

So, why in a zope package? Because I really think this is a core issue 
of a web framework. Do we really want to not change any zope.* package 
any more in regard to new features?

Regards,
-- 
Christian Zagrodnick · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1
Zope and Plone consulting and development


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Checkins] SVN: zope.app.publisher/trunk/ To make browsers update their caches of resources immediately when the

2009-06-10 Thread Benji York
On Wed, Jun 10, 2009 at 3:51 AM, Christian Zagrodnickc...@gocept.com wrote:

 The checkin actually is two in one (which aruably is not such a good thing):

 1. Make resources compute urls with an IAbsoluteURL adapter so they
 behave like every other object.

 2. Provide an optional hashing adapter (and the ++noop++ namespace).

I'd actually separate number 2 into 2a (hashing adapter) and 2b
(++noop++ namespace).

 I don't think we have to argue about 1.

Agreed.

 The ++noop++ and hashing could easily be moved to a different package.

I'd like to use the ++noop++ functionality separately from the hash
calculating URL generation.

 The idea behind the hasing is that one should not have to think about
 new versions or cache invalidations. That's also why in development
 mode the hash is computed every time and not just once: It aids
 development a lot. But it helps in deployment as well of course.

In my apps, I'll likely store a unique ID for each resource, or even use
(a variation of) the app's version number for resources.  That's why I'd
like to use the ++noop++ namespace without the URL generation policy.

 So, why in a zope package? Because I really think this is a core issue
 of a web framework. Do we really want to not change any zope.* package
 any more in regard to new features?

It is a core issue, but I'm not sure we've decided how to handle it yet.
I'd rather the community try a few things and see if one dominant
approach emerges.  If so, it can be promoted to the zope namespace.  Or
not, there's no reason all widely used packages have to be in zope.*.
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] [Checkins] SVN: zope.app.publisher/trunk/ To make browsers update their caches of resources immediately when the

2009-06-09 Thread Stephan Richter
On Tuesday 09 June 2009, Wolfgang Schnerring wrote:
   To make browsers update their caches of resources immediately when the
   resource changes, the absolute URLs of resources can now be made to
 contain a hash of the resource's contents, so it will look like
   /++noop++12345/@@/myresource instead of /@@/myresource.
  
   - Implemented an AbsoluteURL adapter that computes a hash of the
 resource's contents and inserts that into the URL. - Content hashes will be
 cached in memory, except when in developer mode - Introduced a ++noop++
 traverser that simply throws away the path segment - Wrote a bit of
 documentation about resources

Mmmh, this looks like a lot of extra code to get behavior that is served 
better with different tools. Have you looked at z3c.versionedresource and 
z3c.traverser? Both of those should solve these type of use cases well.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )