Change time of cache expiry - wordpress

I've built my first woocommerce website. It worked great until I've migrated it from my local machine to shared godaddy hosting. This shared hosting has many many limits in loading speed and I've encountered a strange behaviour. I've sent a request to get my website but I have to wait approx. 40 seconds so it loads. After that, all the requests to the server had normal response time (1-5s). But then, after noone had used my website in 1 hour, this behaviour happened again - first load takes 40 secs., after that website is loading normally. I've digged a lot on that and I found that might be the cache issue (I know it might be obvious, but I'm a newbie and it took me a lot to figure it out :D). But I have not really found any solution or help to my issue anywhere in the internet so I'm asking you here for the help. So now, finally, my question is: how do I change the time of expiry for wordpress/woocommere application cache? If I change it to, let's say, 24h, it should work for me I guess. But then comes second question - when I change the cache expiry time for my website, what if I change it's content and let's say add new products to the store. Would it return the cached website without new products? Because if I understand it well, it would be wise to cache as long as possible constant elements (plugins, themes, etc.) but only them, nothing else. I would be really grateful for any help and guidance to eliminate "the first 40s loading time".

Related

TTFB very long first time you access the website

I have an issue with a WordPress website I made: https://j-martini.com
Sometimes (generally the first time you access the website), the time before even HTML gets loaded can be very long (for example on this capture, 8s: https://postimg.cc/qgR0xqKm
I have no idea where the issue is coming from and since every time I test the website with tools such as GTmetrix I get a good result, I don't how to monitor the issue.
I contacted my hosting service, Scaleway, because I'm suspecting a slow server, but they're trying very bad to not help me at all. Even if it doesn't come for the server I kind of hoped that they could help me figure out where the problem is, but apparently not.
Any help would be very appreciated!

First Byte Time scores F

I recently purchased a new theme and installed wordpress on my GoDaddy hosting account for my portfolio. I am still working on it, but as of right now I sometimes get page load speeds of 10-20seconds, and others 2 seconds (usually after the page has been cached). I have done all that I believe I can (without breaking the site) to optimize my performance speed (reducing image sizing, using a free CDN, using W3 Total Cache, etc).
It seems that my main issue is this 'TTFB' wait time I get whenever I go to a new page that hasn't been cached yet. How I can fix this? Is it the theme's fault? Do I NEED to switch hosting providers? I really don't want to go through the hassle of doing that and paying So much more just to have less than optimal results. I am new to this.
My testing site:
http://test.ninamariephotography.com/
See my Web Page Results here:
http://www.webpagetest.org/result/161111_9W_WF0/
Thank you in advance to anyone for your help:)
Time To First Byte should depend on geography. I don't think that's your problem. I reran your test and got a B.
I think the issue is your hosting is a tiny shared instance, and you're serving static files. Here are some ideas to speed things up.
Serve images using an image-serving service. Check out imgix which is $3/m. It could help in unexpected ways serving images off an external domain depending on HTTP protocol version and browser version, and how connections are shared.
Try lossy compression. You lose some image detail, but you also lose some file size. Check out compressor.io for an easy tool.
Concatenate and minify scripts. You have a number of little javascript files that load individually. Consider joining them together and minifying. I don't know the tool chain for Wordpress, perhaps there's a setting?
If none of that helps, you should experiment with different a hosting choice.

Clear browser cache after publish

I tell them my problem. I have a fairly large site, where there are frequent changes. The same is made. Net F 3.5.
My big problem is that every time I make a rise in production I have to send a mail to all the people who use that site to clean your browser history. As it begins to have the same malfunction as it mixes the previous web with the latest version uploaded.
Is there any way to force a refresh of the page to a raise? but without disabling the cache? Since layers increases are 1 per month and cache for the size of the web is very useful.
Greetings and thanks to all

Quickiest way to determine why a site is sluggish?

I just picked up a client who's Wordpress web site takes anywhere between 8 to 22 seconds to START loading. The loading delay also occurs when using the Wordpress backend so I'd like to fix the loading issue first before starting my work (template re-design). What's the quickest yet efficient way to determine why this Wordpress site is taking so long to start loading?
Thanks in advance
P.S. - They currently have a caching plugin installed (WP Super Cache) which I assume the previous web developer installed to help with the loading issue but it only helps with the front-end and not the back-end.
Try to run some test like YSlow and Google Page Speed and read their results and suggestions.
Google Speed Online is helping me a lot with analysis of my websites.
http://pagespeed.googlelabs.com/
I use browsermob. They use real browsers to test the site load performance. Shows very nice graphs showing how long each and every request took. Also shows how many requests happen in parallel. As they use real browser, you can see how long it will take to load on a real browser. Then you can choose from which location you want to test. You can choose a UK location to test how fast your page loads from UK.
By the way, I am in no way related to browsermob. I just happen to be a satisfied user of this.
And it is free.
Your server is probably loading far too many modules and is thrashing the disks as it's run out of memory.
You need to both reduce how much memory each PHP instance consumes and limit how many PHP instances can run simultanouesly to ensure you don't use virtual memory for your PHP instances.
I've written a detailed answer to a very similar problem here on Stack Overflow:
How can I figure out why my Wordpress pages load so slowly?
Well, i have came across a similar situation, such things happen when your website is hosted on a GridHosting server, which means it changes according to the server load, but sometimes the things are just opposite the scenario, the best way to check why it is slow is to first ping the website at random interval , so in this way you will know if the distance is the cause or the packet dropping is the issue, secondly, you need to make sure your server's configurations is good, i.e; request your host about a RAW log of your website, in this way you can know what is it taking long for your server to response, and the least best method is to check and make sure that your DNS resolves in a good time, and try to use some free CDN services like CloudFlare.
Hope this helps.

slow of first page, running on windows/IIS

I'm more into the LAMP stack, but I've been asked to work on a site that is running Windows and IIS 2008. I'm a beginner with IIS, so please be patient with me on this, and please ask me to provide more information if that is needed to determine.
I read the answer here (Slow first page load on asp.net site), but it seems like if I go to the site with one browser it takes long to load the first page, then fast on all other pages, then if I open up another browser, it's the same thing, so it's not something that is saved on the server, but per session?
Is there a way to have the application running at all times?
Right now it is taking 12 to 15 seconds for the first page to load.
I have access to the WebControlCenter and FTP.
I would look in the Global.asax page and see if there is anything going on when a session is started. There usually is a method in there called Session_Start that is called whenever a session is started. Also, it might have to do with the site being configured in debug mode. You can change the web.config setting to false, which has a big impact on performance.
I'm familiar with the phenomenon described in the question you've linked to, but your what you're describing does seem a bit odd.
firstly- try Jeff's suggestion and see if indeed there's something at the beginning of the session which slows it down.
If not- try answering this-
1. is the first page always slow or only on first access to it?
2. what happens if you open another tab in the browser (not a different browser)?
3. it's possibel that the page contains some heavy resources (like images, script files etc.) which are only downloaded on the first access to the page. try tracing your http responses you get and see what their sizes are.
4. try to enable trace on your web page to see the events which are taking the longest time (on aspx you need to add 'Page Trace="true"' to the page declaration)
hope one of these helps...
Have you tried a http debugger here? Lots of things could be going on here, but the fact that you get different behavior by using different browsers indicates it is probably some particular resource that is overweight.

Resources