Performance http2 and sprites

Description:

I wanted faster page loades for tenbruggencatedevelopment.nl The site uses lots off small images (request) so should be improved.


Solution:

By creating sprites of all small images and using Nginx to do parallel request performance(google ranking) should increase. To be able to process parallel request I use docker with nginx and project containers behind the nginx container.

How: First lets create a docker-compose file to configure the containers we need:
docker-compose

Now we to set some config for the nginx container, create a directory named Nginx and create a new file: Dockerfile
FROM nginx

COPY nginx.conf /etc/nginx/nginx.conf
RUN mkdir /etc/nginx/logs
ADD index.html /www/data/

EXPOSE 80
dockerfile

Create a config file for your domain, this file gets copied to the nginx container Nginx conf example

http {
  # nginx logging
  access_log /dev/stdout;
  error_log /dev/stdout;
	error_log /etc/nginx/logs/nginx-error.log;
  sendfile on;

    # yourdomainname.nl
    server {
      listen        80;
      server_name   yourdomainname.nl;

      location /.well-known/acme-challenge/ {
        root /var/www/certbot;
      }

      location / {
        return 301 https://$host$request_uri;
      }
    }

why-guy add:

Last Tweets: