<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">27160</assigned-user-id>
  <attachments-count type="integer">0</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2009-06-22T18:09:05-03:00</created-at>
  <creator-id type="integer">11476</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">34</number>
  <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
  <priority type="integer">106137</priority>
  <project-id type="integer">14675</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>2.3.2 performance slug to_param</tag>
  <title>Cache latest slug in model field for performance</title>
  <updated-at type="datetime">2009-10-19T17:08:05-02:00</updated-at>
  <user-id type="integer">27160</user-id>
  <user-name>Norman Clarke</user-name>
  <creator-name>Luis Lavena</creator-name>
  <assigned-user-name>Norman Clarke</assigned-user-name>
  <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
  <original-body>Hello Guys!

Thanks for this gem! has proven to be a great help dealing with slugs and also with SEO optimizations for our content.

Now, to the feature itself.

On production of one application, we found digging in our performance numbers that friendly_id is a big time eater looking for latest slugs in the relation to properly format all the URLs that re being displayed.

Now, after thinking this a bit. Wouldn't be possible cache the latest slug in the model and, when building to_param for it use it instead of the polymorphic search?

And when searching back with find, find the slug at the model and then use the sluggable ones.

If this sounds logic, maybe a patch can be provided from this end.

Again, thanks for your time and releasing this tool!

Cheers.</original-body>
  <latest-body>Hello Guys!

Thanks for this gem! has proven to be a great help dealing with slugs and also with SEO optimizations for our content.

Now, to the feature itself.

On production of one application, we found digging in our performance numbers that friendly_id is a big time eater looking for latest slugs in the relation to properly format all the URLs that re being displayed.

Now, after thinking this a bit. Wouldn't be possible cache the latest slug in the model and, when building to_param for it use it instead of the polymorphic search?

And when searching back with find, find the slug at the model and then use the sluggable ones.

If this sounds logic, maybe a patch can be provided from this end.

Again, thanks for your time and releasing this tool!

Cheers.</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;Hello Guys!&lt;/p&gt;
&lt;p&gt;Thanks for this gem! has proven to be a great help dealing with
slugs and also with SEO optimizations for our content.&lt;/p&gt;
&lt;p&gt;Now, to the feature itself.&lt;/p&gt;
&lt;p&gt;On production of one application, we found digging in our
performance numbers that friendly_id is a big time eater looking
for latest slugs in the relation to properly format all the URLs
that re being displayed.&lt;/p&gt;
&lt;p&gt;Now, after thinking this a bit. Wouldn't be possible cache the
latest slug in the model and, when building to_param for it use it
instead of the polymorphic search?&lt;/p&gt;
&lt;p&gt;And when searching back with find, find the slug at the model
and then use the sluggable ones.&lt;/p&gt;
&lt;p&gt;If this sounds logic, maybe a patch can be provided from this
end.&lt;/p&gt;
&lt;p&gt;Again, thanks for your time and releasing this tool!&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">27160</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hello Guys!

Thanks for this gem! has proven to be a great help dealing with slugs and also with SEO optimizations for our content.

Now, to the feature itself.

On production of one application, we found digging in our performance numbers that friendly_id is a big time eater looking for latest slugs in the relation to properly format all the URLs that re being displayed.

Now, after thinking this a bit. Wouldn't be possible cache the latest slug in the model and, when building to_param for it use it instead of the polymorphic search?

And when searching back with find, find the slug at the model and then use the sluggable ones.

If this sounds logic, maybe a patch can be provided from this end.

Again, thanks for your time and releasing this tool!

Cheers.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hello Guys!&lt;/p&gt;
&lt;p&gt;Thanks for this gem! has proven to be a great help dealing with
slugs and also with SEO optimizations for our content.&lt;/p&gt;
&lt;p&gt;Now, to the feature itself.&lt;/p&gt;
&lt;p&gt;On production of one application, we found digging in our
performance numbers that friendly_id is a big time eater looking
for latest slugs in the relation to properly format all the URLs
that re being displayed.&lt;/p&gt;
&lt;p&gt;Now, after thinking this a bit. Wouldn't be possible cache the
latest slug in the model and, when building to_param for it use it
instead of the polymorphic search?&lt;/p&gt;
&lt;p&gt;And when searching back with find, find the slug at the model
and then use the sluggable ones.&lt;/p&gt;
&lt;p&gt;If this sounds logic, maybe a patch can be provided from this
end.&lt;/p&gt;
&lt;p&gt;Again, thanks for your time and releasing this tool!&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-22T18:09:05-03:00</created-at>
      <creator-id type="integer">11476</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">34</number>
      <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14675</project-id>
      <state>new</state>
      <tag>2.3.2 performance slug to_param</tag>
      <title>Cache latest slug in model field for performance</title>
      <updated-at type="datetime">2009-06-22T18:09:07-03:00</updated-at>
      <user-id type="integer">11476</user-id>
      <user-name>Luis Lavena</user-name>
      <creator-name>Luis Lavena</creator-name>
      <assigned-user-name>Norman Clarke</assigned-user-name>
      <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">27160</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hey Luis,

Thanks for the feedback. This feature has actually been on my internal to-do list for a few months, and I would love to make it happen. If you want to work on a patch I would most definitely be interested in applying it, and can also help you with development if you want.

This is a feature I see needing a little bit of infrastructure, including a generator to create an upgrade migration for existing installations and a rake task to (re)set the cached values. 

What do you think would be the most appropriate way to implement this, caching the current slug's text value, or caching the current slug's id and loading it via a join? I can see some advantages to either strategy but the best performance would obviously come from the first option.

Norm</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hey Luis,&lt;/p&gt;
&lt;p&gt;Thanks for the feedback. This feature has actually been on my
internal to-do list for a few months, and I would love to make it
happen. If you want to work on a patch I would most definitely be
interested in applying it, and can also help you with development
if you want.&lt;/p&gt;
&lt;p&gt;This is a feature I see needing a little bit of infrastructure,
including a generator to create an upgrade migration for existing
installations and a rake task to (re)set the cached values.&lt;/p&gt;
&lt;p&gt;What do you think would be the most appropriate way to implement
this, caching the current slug's text value, or caching the current
slug's id and loading it via a join? I can see some advantages to
either strategy but the best performance would obviously come from
the first option.&lt;/p&gt;
&lt;p&gt;Norm&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-24T10:08:20-03:00</created-at>
      <creator-id type="integer">11476</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">34</number>
      <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14675</project-id>
      <state>open</state>
      <tag>2.3.2 performance slug to_param</tag>
      <title>Cache latest slug in model field for performance</title>
      <updated-at type="datetime">2009-06-24T10:08:23-03:00</updated-at>
      <user-id type="integer">27160</user-id>
      <user-name>Norman Clarke</user-name>
      <creator-name>Luis Lavena</creator-name>
      <assigned-user-name>Norman Clarke</assigned-user-name>
      <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">27160</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Hi,

I've started working on this feature. You can see that on http://github.com/nono/friendly_id/tree/cache_slugs. What do you think of my commits?

By the way, thanks for friendly_id. It's a great plugin.

Bruno</body>
      <body-html>&lt;div&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I've started working on this feature. You can see that on
&lt;a href=
&quot;http://github.com/nono/friendly_id/tree/cache_slugs&quot;&gt;http://github.com/nono/friendly_id/tree/cache_slugs&lt;/a&gt;.
What do you think of my commits?&lt;/p&gt;
&lt;p&gt;By the way, thanks for friendly_id. It's a great plugin.&lt;/p&gt;
&lt;p&gt;Bruno&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-09-21T20:12:48-03:00</created-at>
      <creator-id type="integer">11476</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">34</number>
      <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14675</project-id>
      <state>open</state>
      <tag>2.3.2 performance slug to_param</tag>
      <title>Cache latest slug in model field for performance</title>
      <updated-at type="datetime">2009-09-21T20:12:50-03:00</updated-at>
      <user-id type="integer">14798</user-id>
      <user-name>Bruno Michel</user-name>
      <creator-name>Luis Lavena</creator-name>
      <assigned-user-name>Norman Clarke</assigned-user-name>
      <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">27160</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>So far so good! Thanks for taking this on.</body>
      <body-html>&lt;div&gt;&lt;p&gt;So far so good! Thanks for taking this on.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-09-21T21:48:38-03:00</created-at>
      <creator-id type="integer">11476</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">34</number>
      <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14675</project-id>
      <state>open</state>
      <tag>2.3.2 performance slug to_param</tag>
      <title>Cache latest slug in model field for performance</title>
      <updated-at type="datetime">2009-09-21T21:48:42-03:00</updated-at>
      <user-id type="integer">27160</user-id>
      <user-name>Norman Clarke</user-name>
      <creator-name>Luis Lavena</creator-name>
      <assigned-user-name>Norman Clarke</assigned-user-name>
      <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">27160</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>This feature was just released in 2.2.0. Many thanks to Bruno Michel for the patches!</body>
      <body-html>&lt;div&gt;&lt;p&gt;This feature was just released in 2.2.0. Many thanks to Bruno
Michel for the patches!&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-10-19T17:08:02-02:00</created-at>
      <creator-id type="integer">11476</creator-id>
      <diffable-attributes type="yaml">--- 
:state: open
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">34</number>
      <permalink>cache-latest-slug-in-model-field-for-performance</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">14675</project-id>
      <state>resolved</state>
      <tag>2.3.2 performance slug to_param</tag>
      <title>Cache latest slug in model field for performance</title>
      <updated-at type="datetime">2009-10-19T17:08:05-02:00</updated-at>
      <user-id type="integer">27160</user-id>
      <user-name>Norman Clarke</user-name>
      <creator-name>Luis Lavena</creator-name>
      <assigned-user-name>Norman Clarke</assigned-user-name>
      <url>http://randomba.lighthouseapp.com/projects/14675/tickets/34</url>
    </version>
  </versions>
</ticket>
