g1smd - 1:23 pm on May 22, 2012 (gmt 0) [edited by: g1smd at 1:38 pm (utc) on May 22, 2012]
I wouldn't send 410 for URLs that have never existed (your code does that, and that is a problem).
You're creating a problem when a new page comes online and the status changes from "410 Gone" to "200 OK".
Is the site database driven? If so it is a simple task to tie this to that data. Set up a separate table that records the ID of products as they are deleted from the main product table. Amend your script to check both tables. If product found, then show it. If the ID is found in the "deleted" list then return 410, otherwise return 404.
Do the job properly. A five minute hack will create more long term problems than it solves.
[edited by: g1smd at 1:38 pm (utc) on May 22, 2012]