minification via middleware

1 view
Skip to first unread message

Mark Ramm

unread,
Oct 6, 2008, 10:57:11 AM10/6/08
to toscawidge...@googlegroups.com
repoze.squeeze looks like a great addition to ToscaWidgets as it "
uses statistical analysis to determine the optimal bundles based on
the HTML documents that pass through it." So, it should combine and
compress resources on the way out of a ToscaWidget using app in an
intelligent way. I have even heard that there is talk of extending
repoze.squeeze to support a content delivery network, which would be
even more awesome.

http://pypi.python.org/pypi/repoze.squeeze

--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

Luke Macken

unread,
Oct 27, 2008, 3:43:05 AM10/27/08
to toscawidge...@googlegroups.com
On Mon, Oct 6, 2008 at 10:57 AM, Mark Ramm <mark.mch...@gmail.com> wrote:

repoze.squeeze looks like a great addition to ToscaWidgets as it "
uses statistical analysis to determine the optimal bundles based on
the HTML documents that pass through it." So, it should combine and
compress resources on the way out of a ToscaWidget using app in an
intelligent way.  I have even heard that there is talk of extending
repoze.squeeze to support a content delivery network, which would be
even more awesome.

http://pypi.python.org/pypi/repoze.squeeze

This definitely looks like it has a ton of potential, and I think it greatly complements TW.  However, I've been encountering many issues trying to get it to actually work.

It's get_url method seemed to be adding an extra slash after my baseurl, which caused its resource cache lookups to fail.  Making this naive change to the get_url method seemed to "fix" it.
 
-    return "/".join((url.rstrip('/'), src))
+    return urlparse.urljoin(url, src)


After making this change, I'm now hitting this exception:

 File "repoze.squeeze/repoze/squeeze/processor.py", line 58, in get_merged_resource
    if expires is None or ttl < expires:
TypeError: can't compare datetime.datetime to NoneType


I seems as if I have something misconfigured, or there are still quite a few bugs to be worked out.


luke

Mark Ramm

unread,
Oct 27, 2008, 11:41:55 AM10/27/08
to toscawidge...@googlegroups.com
You might get better help on the repoze project mailing list as I'm
pretty sure they use this in production in a couple places.

--Mark

--

Reply all
Reply to author
Forward
0 new messages