Wedge

Public area => The Pub => Features => Topic started by: Arantor on March 4th, 2012, 06:41 PM

Title: Pretty URLs things
Post by: Arantor on March 4th, 2012, 06:41 PM
Just playing around with it now.

* Board URLs
 They're not set up in the DB properly for any boards other than the first one, so we will need to fix that at some point, on my test site, smf/wedge/general is the first board, as it should be, but a new board created before PURLs was enabled is simply internally as /new-board-1/ rather than having the prefix.

* Topic URLs
 I was going to say this was broken but I rechecked the DB and hadn't updated the key on it. Mind you, if the topic ID is in the URL, why exactly do we need to cache/index the title separately?
Title: Re: Pretty URLs things
Post by: Nao on March 15th, 2012, 01:18 AM
- Board URLs: I think you're supposed to rename your boards manually. And yes, I guess it'd be nicer to automatically fill in the names based on the board names...

- Topic URLs: yes, the key was updated to lose the uniqueness. The title needs to be cached because generating it is quite expensive (especially if it has special chars in it), and we need to replace topic IDs with topic URLs on the entire page in realtime. So it's really not for determining the ID of the current topic URL, it's the other way around. Did I fail at something..?
Title: Re: Pretty URLs things
Post by: Arantor on March 15th, 2012, 01:28 AM
Quote
- Board URLs: I think you're supposed to rename your boards manually. And yes, I guess it'd be nicer to automatically fill in the names based on the board names...
Not what I'm getting at. Physically the wrong URL is put into the DB at board creation time.

The first board, correctly, has smf/wedge/general as its URL (reflecting the fact this is running on http://smf/wedge/) but the second board only has new-board-1 which is handled as a complete URL, i.e. off site to another domain.
Quote
- Topic URLs: yes, the key was updated to lose the uniqueness. The title needs to be cached because generating it is quite expensive (especially if it has special chars in it), and we need to replace topic IDs with topic URLs on the entire page in realtime. So it's really not for determining the ID of the current topic URL, it's the other way around. Did I fail at something..?
I don't think you failed at anything, it's more a case of I see the option in the admin panel but it's really not clear what the option was supposed to do (especially as in ye olden PURLs times, it would cache the title for lookup purposes, not for saving effort during conversion)

Also, is it actually faster to do a query than it is to just do the replacements?
Title: Re: Pretty URLs things
Post by: Nao on March 15th, 2012, 08:01 AM
Quote from Arantor on March 15th, 2012, 01:28 AM
Not what I'm getting at. Physically the wrong URL is put into the DB at board creation time.
I see. I'll have to look into it, then...
Quote
I don't think you failed at anything, it's more a case of I see the option in the admin panel but it's really not clear what the option was supposed to do (especially as in ye olden PURLs times, it would cache the title for lookup purposes, not for saving effort during conversion)
If I remember correctly (haven't played with my code for a while), there are two caches in Wedge: the topic cache, and the URL cache.
The topic cache is always used, we take topic IDs in the page and fetch topic name URLs based on that.
The URL cache is only used if enabled. It takes an entire topic (or board, or whatever!) URL string and matches it against the cache and replaces it on the fly. The topic cache will still require doing a lookup on board URLs to 'add' to the final topic URL, for instance.
Quote
Also, is it actually faster to do a query than it is to just do the replacements?
It certainly was faster back when I tested, otherwise I'd have removed the feature... But it's disabled by default for two reasons: the URL cache can easily become very crowded, sometimes the biggest table after the message table... Precisely because it stores every variation of every possible URL it finds. The second reason is that performance is only going to be an issue on large communities.
Title: Re: Pretty URLs things
Post by: Arantor on March 15th, 2012, 02:39 PM
Hmm, seems like the caches may be OK then. It's just one of those things I don't really know that much about, you know?
Title: Re: Pretty URLs things
Post by: Nao on March 15th, 2012, 03:49 PM
It's there, off by default, works, doesn't bother anyone ;)
Title: Re: Pretty URLs things
Post by: Arantor on March 29th, 2012, 12:51 AM
Also, should category URLs (e.g. wedge.org/category/x/) be pretiffied with the category name?
Posted: March 29th, 2012, 12:51 AM

Or, for that matter, media items? I think it would be pretty neat to offer it, even if it's off by default.
Title: Re: Pretty URLs things
Post by: Nao on March 29th, 2012, 11:55 AM
Quote from Arantor on March 29th, 2012, 12:51 AM
Also, should category URLs (e.g. wedge.org/category/x/) be pretiffied with the category name?
Yes. Just never got around to doing it. And I'm thinking that these could be stored somewhere that QueryString.php could access without a query... (Heck, actually maybe ALL boards should do it that way.) Because -- I mean -- there are never going to be many categories around anyway, so it's easy data to cache.
Quote
Or, for that matter, media items? I think it would be pretty neat to offer it, even if it's off by default.
Same thing, yes.
Are you suggesting that we put non-topic URL information into a new table where any kind of data could be stored, i.e. helpful for plugins too? :P (Or am I :lol:)

PS: I'm thinking of tags, too... Although they're not implemented in Wedge for now, they can be seen in action at Noisen.com, and they work great. Especially on blogs really. Like this one(http://photomavincz.noisen.com/).
Title: Re: Pretty URLs things
Post by: Arantor on March 29th, 2012, 11:59 AM
For the former, I would love to see both boards and categories stored in a decent-life cache so it can be accessed without any hassle from QueryString.php, which would make it faster without doubt.

I'd love to see a setup whereby plugins can declare - if they want to - new pretty filters for items. Though I'm honestly not sure how much it would require since I'd typically imagine that plugins would probably handle it themselves for the most part - but if it can be added sanely, all for it.
Title: Re: Pretty URLs things
Post by: Arantor on April 26th, 2012, 12:08 AM
Idle thought, seeing that we have wedge.org/board/board/topic_id, what would happen if one created a board whose URL slug was a number?
Title: Re: Pretty URLs things
Post by: Nao on April 26th, 2012, 08:12 AM
Iirc it will be rejected.
Title: Re: Pretty URLs things
Post by: godboko71 on April 30th, 2012, 11:03 AM
But nao I have a reunion forum and it's boards are named by year :p


Not really.