Giter VIP home page Giter VIP logo

Comments (4)

uPagge avatar uPagge commented on June 5, 2024 1

Sure, here you are

location ~* ^(/blog/content/images/)(.+)\.(png|jpe?g)$ {	
        expires max;
        alias /var/struchkov.dev/ghost/www/images;
        set $webp_image_subdir "/webp/";
        set $basename $2;
        try_files $webp_image_subdir$basename$webp_suffix $uri @ghost;
}

/var/struchkov.dev/ghost/www/images - full path to images
/var/struchkov.dev/ghost/www/images/wepb/ - full path to webp images

from simply.

uPagge avatar uPagge commented on June 5, 2024

wow cool feature, but the size is not always smaller.

For my website images, I use the following formula. I distribute them using nginx bypassing the call to Ghost, I also optimized all the images by losslessly compressing them and making a copy of each image in webp.

Thus, if I have webp, then I give it away, if it doesn’t exist, then I give the picture using nginx, and only if it is not in the folder yet, this happens with new pictures, then we send a request to ghost and it creates pictures in its directories and further they will be distributed from there.

It was for general education, suddenly it will be useful to someone, the essence of my message is different. I had jpg pictures weighing 43 kilobytes, after converting to webp they became all 141 kilobytes, I don’t know why, I also thought that webp should be smaller

from simply.

yogeshbeniwal avatar yogeshbeniwal commented on June 5, 2024

@uPagge Can you share nginx configuration changes and other settings change you are doing to serve images?

from simply.

uPagge avatar uPagge commented on June 5, 2024

By the way, I tried this function, but for some reason my images were not converted using Ghost

from simply.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.