[Zen Cart] .htaccess Optimization

Explain your request with as much detail as possible.
BlessIsaacola
Follower
Posts: 98
Joined: Sun Feb 03, 2008 9:48 pm
Location: Kennesaw, GA
Contact:

[Zen Cart] .htaccess Optimization

Postby BlessIsaacola » Mon Feb 18, 2008 3:39 pm

It would be nice to see some code optimization for the .htaccess file in the future. Currently with just one language (no multi-languague support), the file is more than 100kb. Considering that the .htaccess is referenced frequently, an optimization will help with performance.
http://www.clevershoppers.com - Where Clever People Shop!

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: .htaccess Optimization

Postby inveo » Mon Feb 18, 2008 3:51 pm

You can now already do some optimizations which may heavily decrease number of RewriteRules.
  • Remove all unused Product Types in Zen Cart administration (Zen Cart administration - Catalog - Product Types)
  • lower category depth as possible in msu_tweak.pohp
Both actions require re-generating .htaccess file.

With Magic SEO URL Core 1.x series, no other optimizations are expected (it is caused by used technique). Another story is Magic SEO URL Core 2 which is under development and is using only three Rewrite Rules :) (but there is lot of work to keep all known Features and we also want to introduce number-less URI with this new Core).

BlessIsaacola
Follower
Posts: 98
Joined: Sun Feb 03, 2008 9:48 pm
Location: Kennesaw, GA
Contact:

Re: .htaccess Optimization

Postby BlessIsaacola » Tue Feb 19, 2008 9:14 am

It's really not a big deal just a suggestion. Even doing what you suggested only drop the file from 100+kb to 70+kb which is more than 30% reduction but still a big file none the less.
http://www.clevershoppers.com - Where Clever People Shop!

Spike00
Posts: 15
Joined: Sat Nov 08, 2008 9:29 am

Re: [Zen Cart] .htaccess Optimization

Postby Spike00 » Mon Nov 17, 2008 11:11 am

Hi Jiry, could you please explain what you mean by 'remove unused product types'?

Simply removing unwanted records from the table 'product_types'? only this?

Thanks

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] .htaccess Optimization

Postby inveo » Mon Nov 17, 2008 11:13 am

Zen Cart administration - Catalog - Product Types

Spike00
Posts: 15
Joined: Sat Nov 08, 2008 9:29 am

Re: [Zen Cart] .htaccess Optimization

Postby Spike00 » Mon Nov 17, 2008 11:29 am

Hmmm from there we can only edit or edit layout, not remove. I don't understand, sorry.

inveo
Inveo Support
Posts: 1285
Joined: Sat Feb 02, 2008 12:07 pm
Contact:

Re: [Zen Cart] .htaccess Optimization

Postby inveo » Mon Nov 17, 2008 11:42 am

If you don't see delete button, open admin/product_types.php and change:

Code: Select all

//        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=layout') . '">' . zen_image_button('button_layout.gif', IMAGE_LAYOUT) . '</a>' );


to:

Code: Select all

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . zen_href_link(FILENAME_PRODUCT_TYPES, 'page=' . $_GET['page'] . '&ptID=' . $ptInfo->type_id . '&action=layout') . '">' . zen_image_button('button_layout.gif', IMAGE_LAYOUT) . '</a>' );