History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-3807
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Matthew Weier O'Phinney
Reporter: julien PAULI
Votes: 7
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

URL assembly should include a trailing slash

Created: 30/Jul/08 08:46 AM   Updated: 05/Nov/08 08:25 AM
Component/s: Zend_Controller
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

Tags:
Participants: julien PAULI and Matthew Weier O'Phinney

Sub-Tasks  All   Open   

 Description  « Hide
I cant find that in the RFC2616, but it's a well known issue.
A request on http://my-server/my/ressource asks for the ressource file and not a directory.
Assuming that the ressource doesn't exist but is in fact a directory, some servers will then redirect the client to the right URL : http://my-server/my/ressource/ (note the final slash)

Apache's mod_rewrite seems to correct that, but some other servers would not .
As an exemple, try to ask for http://www.google.com/services , and watch the response from GWS.
It responds a 303 code with a location to http://www.google.com/services/ (note the final slash).

This wastes ressources, both for the server, and all the Internet links as 1 HTTP request in fact needs 2...

Zend Framework's router does not generate final slashes on ressources, for exemple, try to use the url() view helper and you will notice that.
This is mitigated by the fact that Apache's mod rewrite correct that, preventing a 30* response, but the problem is still present.

For more information I suggest :
http://developer.yahoo.net/blog/archives/2007/07/high_performanc_9.html
http://httpd.apache.org/docs/2.0/mod/mod_dir.html



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Matthew Weier O'Phinney - 05/Nov/08 08:25 AM
But what if you're using a Regex route, and your route can end in a file suffix? It seems to me that this should be either (a) optional, and/or (b) something defined in individual route assembly.