Magento – Catalog URL Rewrite after daily import/update of Product

url

We have a scenario where we import/update products (about 12K of them) on daily basis, everything is working fine with the imports. We have different store-views (languages) in a shop.

But when the products are loaded in front-end most of the time taken is during router_match, which is a show-stopper and the details page is very slow, which is unacceptable. We found that when the products are imported/updated a permanent-redirects are created with appended url like shoes-1.html. And resolving the actual URL is taking a lots of time.

I found few ways to truncate core_url_rewrite table and re-run reindexer. But as I look further and found that this is NOT recommended on Production. Can somebody please point out why, perhaps because of some links being shared across other sites or may be Google indexed pages. But if I don't care for these (our shop is a closed site – Only registered user are allowed). Will this have any other impacts.

Also is there any way to fix this – "nicely", even for open shops?

Best Answer

Catalog URL Rewrite is a heavy index to run if you have thousands of skus. I'd recommend setting it to update manually not on save. You can do this programatically in your import script. Then have your import script run the index once when it's done importing all the products. You can also have your import script set the index mode back to "update on save" after it has run the index manually.

As for the "-1" on the end of urls. I've seen this happen in different configurations, particularly if you have a flat product catalog without unique category names in the urls. There have been some bugs with this behavior in different versions of Magento. The worst we found is that those number would increment with each index run. So one day the page is shoes-1.html, the next it's shoes-2.html, etc. Definitely do some testing on that if the pages are public. If everything stays a private sale this may not be critical for now. But do resolve this because as the url keys change, the records for the old url keys remain. This will also contribute to bad performance as you can easily get millions of unneeded core_url_rewrite rows over time.

Related Topic