How do you evaluate a site in relation to "calls" (4 posts)

  1. martcol
    Posted 4 years ago #

    As I've gone along with WP I keep reading about calls. This is particularly in relation to plug ins. I often read warnings that doing a particular thing will add extra calls.

    So, I can see that this is a bad thing and that it might affect page load times but how do you evaluate a site to find out if there are too many and exactly what is a call?

    I suppose that it's something to do with the way that WP accesses or communicates with PHP but that's about as much as I can work out.

    Still, at the stage I am at I'm not sure I could do much about it but are ther any guiding principles? And would it be different for mobile sites?



  2. Rebecca O'Brien
    Posted 4 years ago #

    You're probably reading about website optimization, in which case you'll hear about (mainly) two types of "calls)

    - HTTP requests (loading images, javascript, etc.)
    - Database queries (WordPress tends to be overly heavy on these)

    HTTP requests are usually the biggest hit, which is why CSS sprites are so popular now. Basically, each time you include an image on your page (even if it's on your own server) consider it to be the same as opening a second web page. The time to load isn't the same, but the principal is. The server has to fetch the content and send it to the user. Only so many elements can be loaded at once, so the more image/JS/CSS files you have, the longer the page takes to load.

    DB queries are typically bogged down in the transmission. A query requires PHP to send the request to MySQL, MySQL to generate the results, and the results to make it back to PHP. It actually doesn't take terribly long for MySQL to execute a query, it's that latency between the two servers that gets ya. It's important when writing custom queries to consolidate them as much as possible to prevent repeatedly pinging the MySQL server.

    How do you evaluate? Use a plug-in like ySlow (Chrome or Firefox) to see how your site is graded. It's a pretty good indicator of how you're doing as far as speed optimization.

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    HTTP requests are usually the biggest hit

    I'm not so sure of that. CSS & scripts are cached by the browser, so it's only the first page that takes the biggest hit. In comparison, db queries can't be cached, so they affect every page.

  4. martcol
    Posted 4 years ago #

    Thank you.

    I guess in relation to wordpress, I often read it in relation to WP plugins. Sometimes authors warn that using a plug in adds extra calls and explain whay and sometimes people are critical of plug ins and warn about it.

    I suppose if I decide to use a plug in with that kind of warning, I have to weigh it up for myself in relation to the wieght of a page or site.

    Thanks again


Topic Closed

This topic has been closed to new replies.

About this Topic