A Service Worker as your Image Optimization Service

  • Home
  • Blog
  • A Service Worker as your Image Optimization Service
A Service Worker as your Image Optimization Service Results

When choosing an Image Service / Image CDN such as imghaste or any other similar product for that matter, you always aim to to improve performance in the user perspective as well as turn the search engines in your favor. Some of the Key Performance Indicators are the following:

  • Speed up website loading speeds overall
  • Serve from multiple locations across the globe
  • Serve Next Generation Images
  • Page Size Reduction
  • Reduce Page Loading Times
  • Server load reduction by up to 90%
  • Defer off-screen images
  • Serve Retina Ready images for Mobiles, Tablets etc.
  • Single process for designers (you only need one image)

If you haven’t heard of a service worker before, you can take a look over the brand new fancy tech at this blogpost which explains what is a service worker and how it works.

Key benefits of using a Service Worker

SEO Friendly

While all services claim to be SEO Friendly, the harsh truth is exactly the opposite. You will certainly get some benefit from the speed increment but you will lose a portion from rewritting your URL to the image service.

The only companies that provide true SEO Friendliness when it comes to Image Optimizations is currently Cloudflare, AWS, Akamai & ImgHaste

BOT Transparent

As of today (2020) all bots, crawlers, etc will not detect or register our service worker on your website (which is a good thing), hence you won’t suffer from any unwanted overcharges from bot traffic that comes and crawl. Our service is built for improving user experience, and user experience only. You only pay for your users and not the bots that come and crawl.

If you are worrying about your search indexing due to bot transparency you may look up for Google Confirms Chrome Usage Data Used to Measure Site Speed, which makes GTMetrix & Google Pagespeed Insights kinda irrelevant.

How about the new changes on Web Vitals?

We built the Our Service for that matter. We are proud to be the first early adopters to this tech and hope many more will join us soon.

Platform Agnostic

Whether your website runs on PHP, NodeJS, Python, .NET or JAVA. The integration is totally agnostic as long as your website runs on https you are eligible for a service worker.

This comes specially handy when you are creating an Image Service / Image CDN such as imghaste and you need to support WordPress, Prestashop, Magento, Drupal, Custom websites, because it just works on a different Layer.

Disadvantages of the approach

Skepticism

We are always Skeptical when it comes to change. I was skeptical of the Service Worker Idea myself. Why change the old team if its winning right? We’ve come to the conclusion that radical change is coming whether we like it or not. We can either adopt it the the easy way or the highway. We needed to pivot and so we did.

Lack of history data

Even though Service Workers exist in our browsers for more than 4 years now, we don’t really have a lot of case studies or production ready products that adopt them.

Therefor, for a long time they stayed under the radar, plus learning curve isn’t exactly helpful.

There can be Only One!

As per the specification, there can be only one Service Worker registered under the same scope (usually the document root /). As long as the developer completely understands how it works there should no issues nor drawbacks on that.

Just keep in mind that Service Workers are not meant to be treated the same way as normal JavaScript that we can inline on a Web page. It’s meant to be registered & activated when its ready

Tradeoffs

Doesn’t work the first time.

For most early adopters this is considered as a disadvantage on a Service Worker Life Cycle. Yet this also enables features that normal JavaScript can’t achieve on its own. (Such as Background Sync, Web Push etc.)

There are workarounds that will force reload the page after the service worker activation, but it feels like trying to force an asynchronous process to become synchronous without any reason.

Hard to adopt by major vendors

While Service workers are fairly easy to implement over a single website, this gets tricky when talking about adding Service Worker support to major vendors core platforms such as WordPress, Magento etc. They still have a lot of work to do and we will keep an eye on this.

Conclusions

We are absolutely certain that we made the right choice to be early adopters of Service Workers specification for our Image Service.

We strongly believe that 2021 will be the year of Progressive Web Apps and our Image Service is a Service Worker ready Software. Many enterprise business have adopted the Tech and there are big funds supporting it.

Its new & shinny tech and there no doubt the developer community will embrace it and will definitely try to own it. As soon as this happens, All Major Vendors will do their best to get involved.