Blog

Magento Cloud Page Cache Hit Rate with New Relic Logs

Published: December 30, 2020

Tags:

Way back in 2016, I spoke extensively about monitoring page cache hit rate in Magento. The content (and code) was based on the Magento 1 full page cache implementation. Now, four-and-a-half years later I wanted to give an update on the topic, discussing how we can now do this out of the box via New Relic logs for merchants running on Magento Cloud.

Magento Cloud Response Times as measured by Fastly in New Relic

Published: December 29, 2020

Tags:

Recently I’ve been dealing with a Magento performance issue that appears to been caused by Fastly (more on that in another post). Here I wanted to share a quick tip on how to view Fastly response times for Magento Cloud in New Relic.

Embedding Dynamic Content Without Sucking

Published: December 18, 2020

Tags:

A common pattern for embedding dynamic content on the web looks something like this:

<div id="content-will-go-here"></div>
<script src="//vendor.com/inject-content.js"></script>

In this example, the <div> is initially empty on the page, and then the JavaScript pulls content from a 3rd party and dynamically injects it into the <div>.

While this strategy makes sense in principle, there are a number of issues with the markup presented above. In this post we’ll look at how to fix up this approach so that is no longer sucks.

Testing Log Output in Go with logrus

Published: November 15, 2020

Tags:

logrus provides a nice facility for testing logging, which is documented in the README. While the README gives you a general idea of the offering, it doesn’t provide any opinions on how to structure your project to support log testing, leaving you on your own to decide on a strategy. Here I wanted to show you the strategy I came up with and am currently using on my project dbanon.

Analyzing Web Vitals Stored in Google Analytics

Published: November 8, 2020

Google Analytics is a convenient (free) place to store Web Vitals “field measurements”. The Google Chrome team has provided extensive instructions on how to do this.

When it comes to analyzing the data, the instructions are a bit more vague. If you spend some time trying to dig into the data, one thing will quickly become clear…the Google Analytics UI is not a good tool for this.

Here I’ll cover my approach, which involves extracting the data via the Google Analytics Reporting API and analyzing it with pandas.

Gatling disableFollowRedirect without KO

Published: September 11, 2020

Tags:

I’m currently working on a Gatling simulation which involves sending traffic to an endpoint that issues an HTTP 307 response. For this load test I want to send requests to this endpoint, but I don’t want Gatling to follow the redirect. You can instruct Gatling to not follow the redirect by calling disableFollowRedirect:

http("My request")
    .get("/redirecting-url")
    .disableFollowRedirect

However, doing this will cause Gatling to flag the request as a KO, when the endpoint issues a 307 response.