Issue Details (XML | Word | Printable)

Key: MODPYTHON-142
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Make req.no_cache and req.no_local_copy writable.

Created: 05/Mar/06 04:56 PM   Updated: 11/Apr/07 11:32 AM
Return to search
Component/s: core
Affects Version/s: 3.2.8
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works MP142_20060305_grahamd_1.diff 2006-03-05 06:24 PM Graham Dumpleton 5 kB

Resolution Date: 07/Mar/06 01:57 PM


 Description  « Hide
If a handler sets req.no_cache to be true, then Apache will internally add appropriate "Expires" header. Also the req.no_cache attribute is consulted by mod_cache to know when not to cache. The alternative is that a handler must know to set both:

  req.headers_out['Cache-Control'] = 'no-cache'
  req.headers_out['Expires'] = '-1'

It would be better to allow handlers to set req.no_cache as it isolates them from any future changes in respect of special headers that may need to be additionally set if standards change in any way.

Not entirely sure if req.no_local_copy attribute is somehow related. It somehow affects whether 304 errors are returned in some cases. Certain modules such as mod_include set this, so no reason that a mod_python handler wouldn't want to set it also.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Graham Dumpleton made changes - 05/Mar/06 05:18 PM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Graham Dumpleton made changes - 05/Mar/06 05:47 PM
Description If a handler sets req.no_cache to be true, then Apache will internally add appropriate "Expires" header. Also the req.no_cache attribute is consulted by mod_cache to know when not to cache. The alternative is that a handler must know to set both:

  req.headers_out['Cache-Control'] = 'no-cache'
  req.headers_out['Expires'] = '-1'

It would be better to allow handlers to set req.no_cache as it isolates them from any future changes in respect of special headers that may need to be additionally set if standards change in any way.

Not entirely sure if req.no_local_copy attribute is somehow related. It somehow affects whether 302 errors are returned in some cases. Certain modules such as mod_include set this, so no reason that a mod_python handler wouldn't want to set it also.
If a handler sets req.no_cache to be true, then Apache will internally add appropriate "Expires" header. Also the req.no_cache attribute is consulted by mod_cache to know when not to cache. The alternative is that a handler must know to set both:

  req.headers_out['Cache-Control'] = 'no-cache'
  req.headers_out['Expires'] = '-1'

It would be better to allow handlers to set req.no_cache as it isolates them from any future changes in respect of special headers that may need to be additionally set if standards change in any way.

Not entirely sure if req.no_local_copy attribute is somehow related. It somehow affects whether 304 errors are returned in some cases. Certain modules such as mod_include set this, so no reason that a mod_python handler wouldn't want to set it also.
Graham Dumpleton added a comment - 05/Mar/06 06:24 PM
Attached "MP142_20060305_grahamd_1.diff" containing proposed changes.

Graham Dumpleton made changes - 05/Mar/06 06:24 PM
Attachment MP142_20060305_grahamd_1.diff [ 12323733 ]
Repository Revision Date User Message
ASF #383793 Tue Mar 07 05:53:05 UTC 2006 grahamd The req.no_cache and req.no_local_copy attributes are now writable.
(MODPYTHON-142)
Files Changed
MODIFY /httpd/mod_python/trunk/test/htdocs/tests.py
MODIFY /httpd/mod_python/trunk/Doc/modpython4.tex
MODIFY /httpd/mod_python/trunk/test/test.py
MODIFY /httpd/mod_python/trunk/src/requestobject.c
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h

Graham Dumpleton made changes - 07/Mar/06 01:57 PM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Graham Dumpleton made changes - 11/Apr/07 11:32 AM
Status Resolved [ 5 ] Closed [ 6 ]