[mod_python] If-Modified-Since date parsing?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Mon Sep 24 17:37:32 EST 2001


Python 2.1 (#3, Jun 11 2001, 16:02:23)
[GCC 2.95.2 19991024 (release)] on freebsd4
Type "copyright", "credits" or "license" for more information.
>>> import rfc822
>>> rfc822.parsedate("Tue, 1 Jul 2002 11:11:11 GMT")
(2002, 7, 1, 11, 11, 11, 0, 0, 0)
>>>

HTH,

Grisha

On Mon, 24 Sep 2001 harm at millionmonkeys.nl wrote:

> Moi,
>
> I`m making an little scale-this-image-on-the-fly handler. Works like
> requesting /magicimages/chicken.gif?width=200&height=255 and you will get
> an nicely scaled image. Piece of cake of course and uses a filecache to
> make things nice and speedy.
>
> Now I would like to use the If-Modified-Since header, so I can return the 304
> "Not modified" code. Makes requests go faster for everybody (No unnecesary
> downloads).
> Is there any module out there to parse the date from this header in
> something easier to work with? Example date:
> Tue, 1 Jul 2002 11:11:11 GMT
>
> Thanks,
> Harmen
>
> Ps: The handler needs to scale the usual web-images: gif, jpg and png. I am
> currently using Pythonwares Image (PIM) library. Any better (smaller /
> simpler / more mod_python friendly) suggestions?
>
>
>
>
> --
>                                 The Moon is Waxing Gibbous (55% of Full)
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list