Lazy load images with javascript

Why should you load your images in a lazy way? Among others reasons: Increase page speed:Better page rankMore visitorsReduce bounce rateIncrease pages / session rateImprove user experienceReduce infrastructure costs In a nutshell, this is the process: Modify all your <img /> tags by changing src by data-src or something elseAdd a specific class to every … Continue reading Lazy load images with javascript

Redirect all requests from HTTP to HTTPS un Node.js and Express

The first step will be to create a method to guess if the HTTP request comes from HTTP or HTTPS (secure or not secure). In some context like AWS or Heroku you will have to ask by the header x-forwarded-proto instead of req.secure. Have in mind that req.secure will return always false if there is … Continue reading Redirect all requests from HTTP to HTTPS un Node.js and Express