Re: Changes to tag and rest controllers

Bharat Mediratta <[email protected]> Fri, 17 May 2013 09:04:49 -0700
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CAESa+_=4kszju6hDeY_mrniEy6mgNHLAjF4FWCxDMayQnJ5YGQ@mail.gmail.com>
--===============7572991324512284873==
Content-Type: multipart/alternative; boundary=001a11c2f318e768b004dcec2688

--001a11c2f318e768b004dcec2688
Content-Type: text/plain; charset=ISO-8859-1

(looping back in gallery-devel)

Ok, you convinced me with zip codes.  I don't think that all numeric tags
will be super popular (see http://www.flickr.com/photos/tags/) but I see
that there are at least some useful cases with zip codes :-)

On Fri, May 17, 2013 at 8:41 AM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:

> FWIW, I got a draft of this big conversion coded up on one of my plane
> rides, and am currently debugging it while waiting for my wife to wake up
> from her jetlag-induced sleep... and it works well!  So, we're 100%
> consistent with the new canonical URLs, the old canonical URLs, and mostly
> (but not 100%) consistent with malformed, non-canonical old URLs.
>
>
> On 17 May 2013 17:15, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:
>
>> Hmm... I'm not sure I agree.  For example, this would make folks with
>> photos about 90210, 356, and 1776 really annoyed at the new system.  The
>> simplest rule is the one we don't need :-)
>>
>> My preference is this:
>> - make the new system simple, flexible, and exactly what we want.
>> - provide enough redirects for old URLs to keep most old sites happy
>> during the conversion.
>>
>> Thinking again, there's actually a better rule we can use to deal with
>> old redirects:
>> gallery30x/tag/123/321 --> tag id 123 (which coincidentally has name 321,
>> but this isn't checked) - old canonical URL
>> gallery31x/tag/123/321 --> tag id 123, name 321 (sees slash and tries
>> this), then 301 redirect.
>> gallery31x/tag/123 --> tag name 123, or if none exists, look for a tag id
>> 123 and 301 redirect.
>> gallery31x/tag/321 --> tag name 321 (which coincidentally has id 123, but
>> this isn't checked) - new canonical URL
>>
>> The only oddball case here is old URLs that were truncated *and* coincide
>> with new URLs, for which I don't think we should break our new system to
>> support...
>>
>> Take care,
>> Shad
>>
>>
>>
>> On 17 May 2013 17:06, Bharat Mediratta <[email protected]> wrote:
>>
>>>
>>> I'd prefer to have a simpler rule of "no numeric tag slugs" because that
>>> way we'll have consistent behavior in all cases.  I like simple rules :-)
>>>
>>>
>>> On Fri, May 17, 2013 at 7:55 AM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:
>>>
>>>> Yah, that's easy enough to keep.  Just as you said, the only slight
>>>> wrinkle is numeric tag names, but even then we don't need to *enforce* that
>>>> slugs are non-numeric.  Rather, we just can't forward old URLs that
>>>> coincide with new URLs of numeric tags.
>>>>
>>>> For example:
>>>> gallery30x/tag/123 --> tag id 123.
>>>> gallery31x/tag/123 --> tag name 123, or if none exists, look for a tag
>>>> id 123 and 301 redirect.
>>>>
>>>> Take care,
>>>> Shad
>>>>
>>>>
>>>> On 17 May 2013 16:42, Bharat Mediratta <[email protected]> wrote:
>>>>
>>>>>
>>>>> Keeping around support for tag/<id> shouldn't be too hard, right?  It
>>>>> just means that the user-defined slug can't be purely numeric to avoid
>>>>> conflicts.
>>>>>
>>>>>
>>>>> On Fri, May 17, 2013 at 6:34 AM, Dave Moore <[email protected]>wrote:
>>>>>
>>>>>> On 2013-05-15 8:29 PM, Bharat wrote:
>>>>>> >  The tag/<id>/<name> approach was essentially a fix because
>>>>>> originally
>>>>>> > we did tag/<name> but that was causing problems when we tried to
>>>>>> map a
>>>>>> > slugified tag name in the url back into a tag in the database.
>>>>>> That has been some concern for me and for others as well.  I would be
>>>>>> nice if we could get to: /tag/<name> without the <id> in the url.  If
>>>>>> that could be sorted out then that would make some/lots users/me
>>>>>> happy.
>>>>>> I don't know about backwards compatibility with tag/<id>/<name> is
>>>>>> required or not. I guess it depends on the amount of work required.  I
>>>>>> guess it would be good or if some workaround in the .htaccess could be
>>>>>> provided as a fix, that would work as well.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> AlienVault Unified Security Management (USM) platform delivers
>>>>>> complete
>>>>>> security visibility with the essential security capabilities. Easily
>>>>>> and
>>>>>> efficiently configure, manage, and operate all of your security
>>>>>> controls
>>>>>> from a single console and one unified framework. Download a free
>>>>>> trial.
>>>>>> http://p.sf.net/sfu/alienvault_d2d
>>>>>> __[ g a l l e r y - d e v e l ]_________________________
>>>>>>
>>>>>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>>>>>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> AlienVault Unified Security Management (USM) platform delivers complete
>>>>> security visibility with the essential security capabilities. Easily
>>>>> and
>>>>> efficiently configure, manage, and operate all of your security
>>>>> controls
>>>>> from a single console and one unified framework. Download a free trial.
>>>>> http://p.sf.net/sfu/alienvault_d2d
>>>>> __[ g a l l e r y - d e v e l ]_________________________
>>>>>
>>>>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>>>>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>>>>
>>>>
>>>>
>>>
>>
>

--001a11c2f318e768b004dcec2688
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">(looping back in gallery-devel)<div><br></div><div style>O=
k, you convinced me with zip codes. =A0I don&#39;t think that all numeric t=
ags will be super popular (see=A0<a href=3D"http://www.flickr.com/photos/ta=
gs/">http://www.flickr.com/photos/tags/</a>) but I see that there are at le=
ast some useful cases with zip codes :-)</div>

<div style><br></div><div style><div class=3D"gmail_quote">On Fri, May 17, =
2013 at 8:41 AM, Shad Laws <span dir=3D"ltr">&lt;<a href=3D"mailto:shad@sha=
dlaws.com" target=3D"_blank">shad-xpYdmXCiSuZWk0Htik3J/[email protected]</a>&gt;</span> wrote:<br><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padd=
ing-left:1ex">

<div dir=3D"ltr">FWIW, I got a draft of this big conversion coded up on one=
 of my plane rides, and am currently debugging it while waiting for my wife=
 to wake up from her jetlag-induced sleep... and it works well! =A0So, we&#=
39;re 100% consistent with the new canonical URLs, the old canonical URLs, =
and mostly (but not 100%) consistent with malformed, non-canonical old URLs=
.</div>

<div class=3D""><div class=3D"h5">

<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On 17 May 201=
3 17:15, Shad Laws <span dir=3D"ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSubQFizaE/[email protected]=
m" target=3D"_blank">shad-xpYdmXCiSuZWk0Htik3J/[email protected]</a>&gt;</span> wrote:<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:=
1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left=
:1ex">



<div dir=3D"ltr">Hmm... I&#39;m not sure I agree. =A0For example, this woul=
d make folks with photos about 90210, 356, and 1776 really annoyed at the n=
ew system. =A0The simplest rule is the one we don&#39;t need :-)<div><br></=
div>




<div>My preference is this:</div><div>- make the new system simple, flexibl=
e, and exactly what we want.</div><div>- provide enough redirects for old U=
RLs to keep most old sites happy during the conversion.</div>
<div><br></div><div>Thinking again, there&#39;s actually a better rule we c=
an use to deal with old redirects:</div><div><div style=3D"font-family:aria=
l,sans-serif;font-size:13px">gallery30x/tag/123/321 --&gt; tag id 123 (whic=
h coincidentally has name 321, but this isn&#39;t checked) - old canonical =
URL</div>




<div style=3D"font-size:13px;font-family:arial,sans-serif">gallery31x/tag/1=
23/321 --&gt; tag id 123, name 321 (sees slash and tries this), then 301 re=
direct.</div><div style=3D"font-family:arial,sans-serif;font-size:13px">gal=
lery31x/tag/123 --&gt; tag name 123, or if none exists, look for a tag id 1=
23 and 301 redirect.</div>




<div style=3D"font-family:arial,sans-serif;font-size:13px">gallery31x/tag/3=
21 --&gt; tag name 321 (which coincidentally has id 123, but this isn&#39;t=
 checked) - new canonical URL</div><div style=3D"font-family:arial,sans-ser=
if;font-size:13px">




<br></div><div style=3D"font-family:arial,sans-serif;font-size:13px">The on=
ly oddball case here is old URLs that were truncated *and* coincide with ne=
w URLs, for which I don&#39;t think we should break our new system to suppo=
rt...</div>




<div style=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">Take care,</div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">Shad</div><div style=
=3D"font-family:arial,sans-serif;font-size:13px">




<br></div></div></div><div class=3D"gmail_extra"><br><br><div class=3D"gmai=
l_quote">On 17 May 2013 17:06, Bharat Mediratta <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&g=
t;</span> wrote:<br>




<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><br><div>I&#39;d prefer to have a simpler=
 rule of &quot;no numeric tag slugs&quot; because that way we&#39;ll have c=
onsistent behavior in all cases. =A0I like simple rules :-)</div>




</div><div class=3D"gmail_extra">

<br><br><div class=3D"gmail_quote">On Fri, May 17, 2013 at 7:55 AM, Shad La=
ws <span dir=3D"ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_bl=
ank">shad-xpYdmXCiSuZWk0Htik3J/[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-=
color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">






<div dir=3D"ltr">Yah, that&#39;s easy enough to keep. =A0Just as you said, =
the only slight wrinkle is numeric tag names, but even then we don&#39;t ne=
ed to *enforce* that slugs are non-numeric. =A0Rather, we just can&#39;t fo=
rward old URLs that coincide with new URLs of numeric tags.<div>








<br></div><div>For example:</div><div>gallery30x/tag/123 --&gt; tag id 123.=
</div><div>gallery31x/tag/123 --&gt; tag name 123, or if none exists, look =
for a tag id 123 and 301 redirect.</div><div><br></div>

<div>Take care,</div><div>Shad</div></div><div><div><div class=3D"gmail_ext=
ra"><br><br><div class=3D"gmail_quote">On 17 May 2013 16:42, Bharat Medirat=
ta <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>&gt;</span> wrote:<br>








<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><br><div>Keeping around support for tag/&=
lt;id&gt; shouldn&#39;t be too hard, right? =A0It just means that the user-=
defined slug can&#39;t be purely numeric to avoid conflicts.</div>








</div><div class=3D"gmail_extra">

<br><br><div class=3D"gmail_quote">On Fri, May 17, 2013 at 6:34 AM, Dave Mo=
ore <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"=
_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-=
left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">










<div>On 2013-05-15 8:29 PM, Bharat wrote:<br>
&gt; =A0The tag/&lt;id&gt;/&lt;name&gt; approach was essentially a fix beca=
use originally<br>
&gt; we did tag/&lt;name&gt; but that was causing problems when we tried to=
 map a<br>
&gt; slugified tag name in the url back into a tag in the database.<br>
</div>That has been some concern for me and for others as well. =A0I would =
be<br>
nice if we could get to: /tag/&lt;name&gt; without the &lt;id&gt; in the ur=
l. =A0If<br>
that could be sorted out then that would make some/lots users/me happy.<br>
I don&#39;t know about backwards compatibility with tag/&lt;id&gt;/&lt;name=
&gt; is<br>
required or not. I guess it depends on the amount of work required. =A0I<br=
>
guess it would be good or if some workaround in the .htaccess could be<br>
provided as a fix, that would work as well.<br>
<span><font color=3D"#888888"><br>
Dave<br>
</font></span><div><div><br>
---------------------------------------------------------------------------=
---<br>
AlienVault Unified Security Management (USM) platform delivers complete<br>
security visibility with the essential security capabilities. Easily and<br=
>
efficiently configure, manage, and operate all of your security controls<br=
>
from a single console and one unified framework. Download a free trial.<br>
<a href=3D"http://p.sf.net/sfu/alienvault_d2d" target=3D"_blank">http://p.s=
f.net/sfu/alienvault_d2d</a><br>
__[ g a l l e r y - d e v e l ]_________________________<br>
<br>
[ list info/archive --&gt; <a href=3D"http://gallery.sf.net/lists.php" targ=
et=3D"_blank">http://gallery.sf.net/lists.php</a> ]<br>
[ gallery info/FAQ/download --&gt; <a href=3D"http://gallery.sf.net" target=
=3D"_blank">http://gallery.sf.net</a> ]<br>
<br>
</div></div></blockquote></div><br></div>
<br>-----------------------------------------------------------------------=
-------<br>
AlienVault Unified Security Management (USM) platform delivers complete<br>
security visibility with the essential security capabilities. Easily and<br=
>
efficiently configure, manage, and operate all of your security controls<br=
>
from a single console and one unified framework. Download a free trial.<br>
<a href=3D"http://p.sf.net/sfu/alienvault_d2d" target=3D"_blank">http://p.s=
f.net/sfu/alienvault_d2d</a><br>__[ g a l l e r y - d e v e l ]____________=
_____________<br>
<br>
[ list info/archive --&gt; <a href=3D"http://gallery.sf.net/lists.php" targ=
et=3D"_blank">http://gallery.sf.net/lists.php</a> ]<br>
[ gallery info/FAQ/download --&gt; <a href=3D"http://gallery.sf.net" target=
=3D"_blank">http://gallery.sf.net</a> ]<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div><div style><br></div></div>

--001a11c2f318e768b004dcec2688--


--===============7572991324512284873==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
--===============7572991324512284873==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
--===============7572991324512284873==--