Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   css, javascript and optimization (http://forum.bytesforall.com/showthread.php?t=21463)

emanuel1969 Jan 31, 2014 09:28 PM

css, javascript and optimization
 
This isn't a plugin question but I didn't know where else to ask it. Basically, I am wondering whether I should make my css and js inline or make it an external file? I've been having server load spikes lately, usually when the site gets a lot of traffic. They seem to be related to mysql queries, but I'm not sure. When this happens, pages are taking 10-30 seconds to load, and occasionally people get a timeout error.

So I'm trying to optimize the site, particularly I'd like to reduce mysql queries. I'm assuming that when you make your js and css inline, that this adds two more mysql queries for each page load. Is this correct? And by making it an external file, it does not need to query the database.

I would appreciate anyone's expertise on this issue, aside from my basic question above. Here's the site, if you are interested in seeing it.

http://www.popularresistance.org

Thanks!
Emanuel

juggledad Feb 1, 2014 03:56 AM

Atahualpa reads ALL it's options from the datbase in one query. WordPress will do one query per post. You have 23 posts on your front page so that brings you up to 24 queries. I have no idea how many he header plugin will make or the sidebar widgets.

If you make your CSS/java script external, you will get an extra two requests the first time someone goes to the site which will grab those files and put them in local storage. Subsequent page visits will get less data (the number of bytes in the CSS and Javascript files) so response will be a little longer for the first page and a little shorter when the viewer clickes to an article etc.

do a google search 'wordpress performance' and it looks like you don't have a caching plgin active…why not?

emanuel1969 Feb 1, 2014 09:22 AM

Thanks JD,

We are using the Cloudflare CDN. Doesn't that do what a caching plugin is supposed to do? If not, and you think we can benefit from one, which one do you recommend?

Also, how long does the css/js file stay in storage in the visitor's local browser after they first come to the site? Is it over 24 hours? If someone comes back the next day, for example, will they still be there?

Also, our click rate is 1.7, which means 70% of our clicks occur after someone has arrived for the first time (I think).

juggledad Feb 1, 2014 12:39 PM

As I understand it, a cdn just spreads your media around so multiple requests for the files can process at the same time. A caching plugin will build a page the first time it is visited and store the prebuilt html in a cache so when the next person comes along, no database queries are needed because the page is already built.

As for which to use, you have to test a couple and see which is best for you in your environment. My sites so low activity I don't use one.

Generally there is a settings to control when the cache will expire

emanuel1969 Feb 1, 2014 04:06 PM

Thanks. This is helpful. I'll check out W3 Total Cache.

lmilesw Feb 2, 2014 08:36 AM

You might want to check out some of the latest reviews for W3 Total Cache. There are several other caching plugins you should probably check out.

emanuel1969 Feb 2, 2014 10:20 AM

Thanks again. Do you recommend any that work particularly well with Ata?

lmilesw Feb 2, 2014 01:53 PM

I haven't done extensive testing but I usually end up with WP Super Cache

andrikaa Feb 27, 2014 02:12 AM

Hello, whenever I try to open anything with Javascript, it will not open. When I click on it nothing happens, it just says Javascript and then whatever page I am on at the bottom left. Do you have any idea what this could be? I have the latest version of Java and everything is enabled. Thank you.

juggledad Feb 27, 2014 07:07 AM

@andrikaa - please see this thread


All times are GMT -6. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.