If this is your first visit, check our documentation. To post, register or login.
Forums / Support Site Issues & Questions / I think this page needs to be edited

I think this page needs to be edited

Started by lankeeyankee on 2 May 2016, 11:29 PM · Views: 72

Results 1 to 4 of 4
2 May 2016, 11:29 PM
#1
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

I think this page needs to be edited

https://www.zen-cart.com/content.php?320-Speed-up-site-by-caching-page-assets

It says to put the code in the /includes/.htaccess but that doesn't do anything when reviewing the site in yslow. When it's added to the /htaccess file then it works properly.


Zen Cart and it's community are the best!!

3 May 2016, 2:53 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: I think this page needs to be edited

The reason it's in the /includes/ folder is so that all images/js/css from assets under the /includes/ folder get treated with those rules. Such assets exist under the modules and templates folders.

If your use of yslow is reporting that assets from the /images/ folder are slow, then applying similar rules to the /images/.htaccess would give you the performance gain there. Is that what you were really after?

We specifically wish to avoid providing any .htaccess in the root folder, because that runs the risk of being overwritten when people carelessly blast files onto the server without paying attention to what's already there.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 May 2016, 4:37 AM
#3
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: I think this page needs to be edited

Thanks for the explanation. yslow was saying that all the images plus some js files didn't have expires headers. When I added it to the main htaccess file it fixed it all so that's why I thought it wasn't working properly. Not sure why it doesn't work from the /includes/htaccess so I will try moving it to the images htaccess instead. Not sure if it matters about the js or do I need to make a new htaccess file for the templates/jscript directory?


Zen Cart and it's community are the best!!

3 May 2016, 4:29 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: I think this page needs to be edited

htaccess cascades to all folders below the current one, unless a lower-level htaccess is found, in which case its rules are added to the ones above, and any duplicates supersede those in the one above.

And every .htaccess file creates more CPU/RAM overhead requirement within Apache.

So putting one at /includes/.htaccess should cover everything below that adequately.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.