redirection icon indicating copy to clipboard operation
redirection copied to clipboard

Feature request: storing the creation date

Open mustafauysal opened this issue 8 years ago • 10 comments

Storing the creation date in DB would be useful for the redirection rules. You might not want to alter scheme just for the created_at column. But, please consider this as well, if you need to alter the table for another reason.

mustafauysal avatar Dec 18 '17 12:12 mustafauysal

What would the creation date be used for?

johngodley avatar Dec 18 '17 13:12 johngodley

It would be used as a reminder and debug helper.

Especially, when running a large website that has an editorial team. So many changes happen; automatic redirection rules (because of slug changes), manually added redirection rules (part of the editorial workflow, post deleted, etc..), several bulk imports. So, end of the day it's hard to recognize when the redirection added.

Sometimes facing the problem like this;

Hey! There is a wrong redirection, when did we add this? – Oh! I'm checking the previous backup, and the rule does not exist, this should be new.

:)

mustafauysal avatar Dec 18 '17 14:12 mustafauysal

It would be great to automatically delete redirections not used for more than x months.

I have, in my db, around 600 items that have been never accessed but I don't know with one is new or old. I could use the id to evaluate (more or less) its age but it's quite hazardous.

At the end, I would like a generic SQL request to remove periodically all never used old items to keep the system light.

flooweb214 avatar Mar 02 '23 19:03 flooweb214

I know it is crazy but here you can find a PR #3565 (Not tested, it is just to show my dream)

flooweb214 avatar Mar 02 '23 19:03 flooweb214

Thanks, but adding a database column isn't the difficult part of this. Any feature with the creation date will need a lot more to be added and I would strongly advise you not to do this as it may cause future database problems.

I would like a generic SQL request to remove periodically all never used old items to keep the system light.

Clearing out unused redirects will have no impact on your system performance and negligible impact on storage.

johngodley avatar Mar 02 '23 20:03 johngodley

Thank you for your answer!

Thanks, but adding a database column isn't the difficult part of this. Any feature with the creation date will need a lot more to be added and I would strongly advise you not to do this as it may cause future database problems.

Yes, I understand.

Clearing out unused redirects will have no impact on your system performance and negligible impact on storage.

Oh when I see the number of automatically created redirections, I would expect at least an impact on storage. The contributors on my website often change the slug before to communicate on the post, it creates redirections that are never triggered. On this site, I can see 54 redirections on 250 (in the redirect group) that have never been triggered, almost 22% of items are not useful. If I had all items that have a last_access older than one year r.last_access < DATE_SUB(NOW(), INTERVAL 1 YEAR), I get 67 so I have a little bit more than 26.8% of items that are not used. I would have thought that adding an option to remove these items could reduce a significant proportion row, so the storage. I understand we won't save the planet with that but I feel like it might be a little bit positive still. (But not sure!)

flooweb214 avatar Mar 03 '23 16:03 flooweb214

I would expect at least an impact on storage

Sadly that's not really how databases work and it's unlikely to have any meaningful impact.

I understand we won't save the planet with that but I feel like it might be a little bit positive still

The environmental impact is a good point, but given that you are talking about maybe 2k of data then I think not taking one photo on your phone will have a far greater impact on the planet than 50 or so redirects.

As I discuss here it's likely not something to worry about.

johngodley avatar Mar 03 '23 19:03 johngodley

The environmental impact is a good point, but given that you are talking about maybe 2k of data then I think not taking one photo on your phone will have a far greater impact on the planet than 50 or so redirects.

You're right. If you look at the problem globally, it won't have any impact. If you look at it in a proportional way, I think it can be different. For example, if all digital makers tried to reduce storage by 20%, it would be good news and the same goes for Redirection. Indeed, it's not preponderant but it goes in the right direction. (It's a little bit like in elections: if you don't vote, it won't change anything but it is good to do your part.)

Also I'm thinking about two things:

1 - The message sent to users by getting an option to remove unused data is quite good, it makes people responsible for their actions / datas : you can clean your data (and it is automatic). It has little impact on attitudes, but it is not null.

2 - There might be other people like me and I think it is important to have very clean datas and not to have old and useless rows. In my opinion, to have 20% of redirections without any access is a significant pollution for statistics and debugging. If I could remove it periodically, it would be a pleasure and reassuring in a way.

As I discuss here it's likely not something to worry about.

Really interesting ! You wrote:

If you do want to clean out redirects you can use the ‘last access‘ feature in Redirection to tell you when a redirect was last used. If, after a sufficient period of time has passed, you decide there is no possibility of anyone accessing that redirect then it’s probably safe to remove.

Yes I love "last access" for that! But it is not possible to get never used redirections because "last access" is null. So it isn't possible to really clean.

Anyway, I love Redirection plugin, everything inside it is so well thought, it was a real pleasure to discover it in depth. Thank you very much for that and for your answers.

flooweb214 avatar Mar 08 '23 16:03 flooweb214