On Jun 13, 2007, at 11:27 PM, Oliver Baltzer wrote: > I think it should. I don't see why not.
Flat out simplicity. The AliasPage just has a find_by_url that returns the other page. And since a page can have child pages, if I didn't just re-route the request I'd either have to have an alias for each subchild (ugly) or do some complicated trickery involving creating Page objects on the fly that don't actually exist in the database (which I don't like, but can do if it becomes necessary). I'll admit the AliasPage extension is a dumb hack. But it works, and I think it's simplicity is an example of how the simple framework of Radiant is powerful. I have no objection to altering the extension to do these things so that the resulting page gives the correct URL, if there is a compelling reason for it. But you haven't given me one. >> And I think that redirect is broken for any >> site that has multiple ways to access the same page. > > There is no reason for accessing the _same_ page via multiple ways. > That's just bad design. Compared to a Unix file system, there are > directory entries and there is data. Two directory entries may point > to the same data, but still are distinct directory entires. Asking > either of them for their path will return two different paths. Hard Links. Symbolic Links. Used all the time in Unix to have the same file in multiple places. And, AFAIK, you can't ask "where is this file" once you've opened it. The best you can get is "what path did I open this file with". Ext2 inodes don't even know what their parent is. Directory entries point back to their parents with the ".." link, but files have no concept of where they are stored and it makes links significantly easier. My use of it is to have the same CSS file(s) across multiple sites. But I could see an extension that publishes an address book with URLs like /addresses/<group>/<person>. If a person is in multiple groups, should I have to update multiple pages when their contact information changes? Or shouldn't I be allowed to have a single page with their information and a "groups" part the describes all the groups they are in? What if we added authorization so that not everyone can see every group? How do we handle your redirect now? >> And it sucks from a performance point of view as we have to do >> find_by_url twice >> for the page twice before displaying it. > > Only if it actually needs to be redirected. Apache does not seem to > have a problem to stat a directory twice for the same reason. > Redirects should be fairly infrequent if the web-author is paying > attention. find_by_url is one of the biggest time issues in Radiant, as far as I can tell. Avoiding it would be useful. And I don't see what redirecting to the "one true URL" would help. A site-wide setting for "add a trailing slash" or "remove a trailing slash" (possibly with don't add slashes if there's an extension on the URL), it would be faster and solve the original problem without adding additional cost or complication. Doing what you suggest adds a limitation to Radiant and doesn't provide a significant bonus. That's my issue. ~~ Brian _______________________________________________ Radiant mailing list Post: [email protected] Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
