Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 General
 Off topic, News and Updates
 Cache my PHP pages
Author « Topic »  

Terry Paulhus
Ecommerce Template Expert

Canada
556 Posts

Posted - 01/06/2022 :  13:56:53  
Is there a proper way to cache my php pages? Where does it go on the page and how often page is cached?

Terry (Redsei)

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 01/06/2022 :  14:49:04  
Hi Terry

If your website has very high traffic and also where bandwidth can be an issue then I would prefer to leave caching alone.

Regarding the sites CSS & JS files caching can become a pain in the a**e when you come to update. On your PHP pages it would almost certainly cause issues.

Ideally on an ecommerce site no caching is best IMHO

Steve
Bolton Lancashire

Edited by - 1818charlie on 01/06/2022 14:56:27

dbdave
ECT Moderator

USA
10410 Posts

Posted - 01/06/2022 :  15:01:21  
I agree with Steve.
For the smidgen of speed gain you might see, it's not worth the potential for issues it may cause.
There are many, many posts here where users had issues and it was due to caching they had setup.
I say keep your cache in your pocket. (ca$h pun intended)

David

ITZAP
Ecommerce Template Guru

Australia
1018 Posts

Posted - 01/06/2022 :  17:38:54  
quote:
Is there a proper way to cache my php pages?
Yes Terry, there is. These GTmetrix pages explain the why and how:
> PageSpeed: Leverage browser caching
> Lighthouse: Serve static assets with an efficient cache policy

Why: Page load times can be significantly improved by having the web browser save and reuse the files included on your website; CSS, JavaScript, Images, etc. This reduces page load times for repeat visitors.

How: For an Apache server, copy and paste the sample code into your .htaccess file, then upload to server. Note that:
quote:
If you do change static files often, you can opt for a lower cache expiry as long as it's above 3 months.
Globally 68.1% of all website visits in 2020 came from mobile devices. So PageSpeed load time is important and every optimization you can implement counts.

Analyze the performance of your website here: https://gtmetrix.com/

Gary

Terry Paulhus
Ecommerce Template Expert

Canada
556 Posts

Posted - 01/06/2022 :  17:51:34  
Thanks guys... I leave it alone and check out the .htaccess!

Terry (Redsei)

Steved
Ecommerce Template Guru

United Kingdom
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 01/08/2022 :  13:26:09  
I'm not sure caching css or javascript is a good idea as included in that sample code from Lighthouse.

I can see that causing all kinds of problems if you make changes regularly or when you update.

Steve

Terry Paulhus
Ecommerce Template Expert

Canada
556 Posts

Posted - 01/08/2022 :  13:29:59  
Yes I wasn't sure. Now this business with Googletags being blocked by the browsers... how important is Google anyways....

Terry (Redsei)

ITZAP
Ecommerce Template Guru

Australia
1018 Posts

Posted - 01/08/2022 :  16:11:40  
quote:
I'm not sure caching css or javascript is a good idea ... I can see that causing all kinds of problems if you make changes regularly or when you update.
Steve,
CTRL+F5
Forces a browser cache refresh whenever required. No problem at all.

I have experimented with various methods to improve my website builds PageSpeed ratings, because Google PageSpeed Insights whinges about it.
As you know, Ecommerce websites always contain many Product images, along with CSS, Javascripts and WebFonts. The total filesize of all that content is significant. Implementing browser caching for all of it made the biggest improvement to PageSpeed load time of all.

Sure, decide for yourself whether to leverage browser caching, or not. But I have no doubt that it is well worth it.

Gary

Edited by - ITZAP on 01/08/2022 16:34:41

Terry Paulhus
Ecommerce Template Expert

Canada
556 Posts

Posted - 01/08/2022 :  17:15:02  
Well Gary I do have a site that is loaded with images. I have converted all to webp format and that made a big difference but I'm sure I could do better. I'll give it a look.

Terry

Terry (Redsei)

1818charlie
ECT Moderator

United Kingdom
1194 Posts

Posted - 01/08/2022 :  18:36:50  
Hi Terry

Have a read at Peters comments (insight) regarding the downsides, at the time of posting, of WEBP in this message I posted last year.
https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=113029

Running with just WEBP images will serve WebP to newer browsers but a fallback image format will most likely still be required to serve images to viewers with older browsers. Last time I checked on browser support for WEBP it was around 70% in mid 2020. What it stands at today I couldn't say.

Steve
Bolton Lancashire

Steved
Ecommerce Template Guru

United Kingdom
1022 Posts

Pre-sales questions only
(More Details...)

Posted - 01/08/2022 :  23:09:23  
[quote]Steve,
CTRL+F5
Forces a browser cache refresh whenever required. No problem at all.[/quote]

I was referring to customers returning to sites, not myself.

Steve
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000