Trying to improve my Flatpress blog Pingdom score

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
virtualsky
Posts: 16
Joined: Thu Mar 11, 2021 4:50 am
Location: Saskatchewan, Canada
Contact:

Trying to improve my Flatpress blog Pingdom score

Post by virtualsky » Wed Jun 23, 2021 4:10 am

I've gotten into the habit of running the websites I create (using simple HTML and CSS) through the Pingdom speed test. I always try to achieve a performance grade of A in everything I create.

My Flatpress blogs scores pretty well (a B grade), but there's a recurring F in regards to static components and cookies. The recommendation I get from Pingdom is as such:
When the browser requests a static image and sends cookies with the request, the server ignores the cookies. These cookies are unnecessary network traffic. To workaround this problem, make sure that static components are requested with cookie-free requests by creating a subdomain and hosting them there.
Now, this is a bit over my head, as I'm not quite sure if it's something that I've done with my Flatpress installation, or if it's something inherent with Flatpress itself. Anyone here know what Pingdom might be referring to and how I might be able to address the issue and get a better performance score or my blog?

The full report regarding my Flatpress blog can be found here: https://tools.pingdom.com/#5e8dc10fc2000000

NorfolkGreg
Posts: 26
Joined: Wed Dec 30, 2020 9:58 pm

Re: Trying to improve my Flatpress blog Pingdom score

Post by NorfolkGreg » Thu Jul 01, 2021 8:43 am

I have a similar background to you. All my previous sites have been hand-coded in HTML and CSS, more recently, with some simple PHP includes so I don't have to edit headers, footers and navigation menus on every page.

I'm still exploring what FlatPress has to offer and I, too, have little understanding of some of the things that Pingdom reports on. But my conclusion is that you should not take too much notice of any of it.

Here's the report on my first test page:
https://tools.pingdom.com/#5e98443a3e000000

According to Pingdon my page has three 0 scores (rating F) and has fewer 100 scores than your page yet it's 3 times larger and loads almost half a second faster. In my book that's a satisfactory result.

There may be some aspects of the report that have value, for example, the bit about placing JavaScript at the end of the page. But I don't know that for sure. I know nothing of JavaScript, other than having an unread Teach Yourself in 24 Hours book sitting unread on a shelf. The same goes for most of the other explanations on some of the scores. But I have a sense that the algorithms that generate the scores may be deeply flawed.

The one comment I have about the code that FlatPress generates is that its stuffed full of "src=https://mydomain" and "href=https://mydomain" but I once read that its far more efficient to call relative addresses to avoid having to run through DNS each time you make a call to an absolute address. Maybe that's decade old advice that no longer applies, in the same way that once I was taught always to provide height and width attributes for images, so the page didn't have to re-flow as the images were downloaded. That was certainly true in the days of the Internet Explorer/Netscape wars but is most definitely out of date in the days of HTML5, CSS3 and mobile devices.

NorfolkGreg
Posts: 26
Joined: Wed Dec 30, 2020 9:58 pm

Re: Trying to improve my Flatpress blog Pingdom score

Post by NorfolkGreg » Thu Jul 01, 2021 9:08 am

A further thought on code checking...

Once I had got my head fully around HTML and CSS (quite a few years ago now!), I began to make it a habit of running a selection of pages on a site through the W3C validation checkers. It got the to stage where I rarely wrote pages with errors or warnings.

However, I just tried putting my FlatPress test page through it:
https://validator.w3.org/nu/?doc=https% ... -around%2F
and it appears that some of the JavaScript is less than ideal and the code generated by the Photoswipe plugin produces HTML code with errors. But in spite of 27 errors and warnings Pingdom reports it loading fast and viewing in the various browsers I test with, all appears to render as expected to an ordinary visitor.

In summary, it's nice to have good error-free code as pages will render more reliably, but browsers have so much error trapping within them these days that for most purposes it matters little.

User avatar
virtualsky
Posts: 16
Joined: Thu Mar 11, 2021 4:50 am
Location: Saskatchewan, Canada
Contact:

Re: Trying to improve my Flatpress blog Pingdom score

Post by virtualsky » Thu Jul 01, 2021 4:07 pm

Hey, thanks so much for taking the time to share your thoughts on this with me on this subject. It's not a "mission critical" issue for me (with Pingdom), just a tool that I use to help keep me focused on efficiency. As blogging platforms go, Flatpress has been the easiest for me to use and the most responsive an efficient that I've experience.

And, yes, W3C is also a nice way to check web page efficiency. I should do that more often.

Thanks again!

User avatar
Arvid
FlatPress Coder
Posts: 250
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Trying to improve my Flatpress blog Pingdom score

Post by Arvid » Sat Jul 10, 2021 11:20 am

My two cents on this: I used to spend much time on getting the green check of the W3C validator for my sites. As long as you write everything for yourself, this is a desirable goal, but using a framework like FlatPress makes this way more complicated. How about the 3rd party plugin you use, but it produces HTML errors? You might fix it and send your improvements to the plugin author, but he may have reasons not to re-merge them. Also, a CMS framework may always have edge cases where the output is not 100% valid.
So yes, my goal is to have valid HTML. But I just can't afford to spend 50% of my website-related time to the last 2% of not-so-clean HTML output, so I have quite an amount of pragmatism on this topic. (And it was a learning process to get there :lol: )

As for the PhotoSwipe plugin (of which I happen to be the author), please let me know if you have made any improvements to the code already. I'll have to check the plugin output properly, but I'll also have to find time for that ;)

NorfolkGreg
Posts: 26
Joined: Wed Dec 30, 2020 9:58 pm

Re: Trying to improve my Flatpress blog Pingdom score

Post by NorfolkGreg » Wed Jul 14, 2021 3:21 pm

Arvid wrote: Sat Jul 10, 2021 11:20 amAs for the PhotoSwipe plugin (of which I happen to be the author), please let me know if you have made any improvements to the code already. I'll have to check the plugin output properly, but I'll also have to find time for that ;)
My skills don't include JavaScript, so I won't be able to offer improvements, but your remark here does encourage me to better document the Plugin (and one or two others where I have found undocumented "features"). (See: Comments)

Lubomír Ludvík
Posts: 31
Joined: Wed Feb 20, 2019 7:44 pm
Location: Rouchovany
Contact:

Re: Trying to improve my Flatpress blog Pingdom score

Post by Lubomír Ludvík » Tue Aug 03, 2021 10:25 am

Create a subdomain, for example static.yourwebsite.com and configure flatpress to receive all the static data (.jpg) from subdomain.

Before: <img src="/images/testimage.png" />
After: <img src="https://static.yourwebsite.com/images/testimage.png" />

Source: https://betterstudio.com/blog/use-cooki ... wordpress/

Or try disable Cookies using .htaccess file
Source: https://xpertdeveloper.com/disable-cook ... -htaccess/

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests