4

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?

  • How do you import and update the products? This behavious is not standard. If you update a product, the URL key is not changed. Is the ID changed too? – Fabian Blechschmidt Feb 21 '13 at 12:17
  • Sometimes the names get changed and we have not explicitly defined url_key. The configurable products and relations (associated products) get changed/updated/added/deleted mostly. No the id's are not changed. – Subesh Pokhrel Feb 21 '13 at 12:26
3

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.

  • Is there a way may be during import I "explicitly" define the URL key may be - Just thought while writing this comment so that it will not automatically change to -1 or -2 in URLS? – Subesh Pokhrel Feb 21 '13 at 12:41
  • 1
    @SubeshPokhrel yes, you can specify url_key field so it won't be generated automatically. it's even better to use some attribute in addition to the product name, like SKU or anything relevant – Zifius Feb 21 '13 at 13:04
  • You can also use an alternative indexer, not totally without problems, but if you are talking about 100k+ products, this is worth a shot: ecomdev.org/2011/10/08/ecomdev-breaks-magento-speed-limits.html – Paul Hachmang Feb 21 '13 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.