A couple of days ago I introduced GTmetrix-net, an open source project which makes accessing the GTmetrix API a lot friendlier from within your .Net projects. Since then I’ve added a lot of new features and improvements which I would like to cover within this blog post.
GTmetrix-net what’s new
First and foremost, let’s start with has been added over the last releases;
1 – All Test request parameters are now available within GTmetrix-net.
Within release 0.6 it’s possible to provide any of the available test parameters. The various class constructors are there to simplify the creation of a test request object. Using the constructors is optional given that all features are exposed as RAW properties.
Sample: Using the constructors
Sample: Providing raw values
2 – Async test creation
SubmitTestAsync you don’t have to deal with separate calls for submitting and retrieving your test. This is especially helpful when you want to results as soon as available.
3 – Async polling helper.
GetTestAsync version eliminates the need to poll manually. By default, the wrapper will periodically check if the test results are available. At the moment polling will be performed for a maximum of 10 times with a 2 second wait period between each poll request.
4 – The download helper now supports all possible resource types.
You don’t have to use the download helper because the resource Urls are exposed as part of the test results. However, in my opinion, the download helper makes things a bit easier as demonstrated within the example below.
There are still areas which I would like to improve. For example; specifying a bundle of files you would like to receive. In addition to this I would also like to expose the file extension for each type. For now, I’m just listing them below:
5 – Chrome on Android has been added to the helper functions.
6 – A new connection throttling helper has been added.
- The Browser model now returns the correct browser feature values.
ErrorResultincludes all information as provided by GTmetrix.
- Resolved async execution context issues.
SubmitTestAsyncwon’t check for test results if the creation of a new test fails.
The future of GTmetrix-net
I will maintain and extend GTmetrix-net as I do with all my other projects and currently thinking of adding the following;
- Extending the download helper as mentioned above.
- Typed Models for PageSpeed.json and Yslow.json
- Create a PowerShell wrapper
- Making the polling interval and retry count configurable.
This all depends on how much I desire the features and the amount of time i have available. Of course, comments, contributions and suggestions are always welcome!