Learn about Centmin Mod LEMP Stack today
Become a Member

Wordpress Installing WebP Express Wordpress Plugin on Centmin Mod Nginx

Discussion in 'Blogs & CMS usage' started by eva2000, May 11, 2019.

  1. Shirkit

    Shirkit New Member

    9
    1
    3
    Feb 6, 2019
    Ratings:
    +2
    Local Time:
    9:04 AM
    1.15.8
    No I literally mean there's a new 'Tests' module inside the plugin configuration: https://imgur.com/tzmWlEy

    I know I only need one of the libraries to work, but the tests are failing.
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,504
    10,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,734
    Local Time:
    10:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    You mean those 3x redirection rule tests ? They won't work they test .htaccess apache file. Nginx doesn't support Apache's .htaccess.
     
  3. zkylizer

    zkylizer New Member

    16
    0
    1
    Jun 5, 2019
    Ratings:
    +2
    Local Time:
    7:04 PM
    1.17.0
    MariaDB 10
    if using webp express still need image optimize plugin or not ?
    because in webp expresss already has feature reduce image quality
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,504
    10,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,734
    Local Time:
    10:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yeah you can just use webp express plugin
     
  5. zkylizer

    zkylizer New Member

    16
    0
    1
    Jun 5, 2019
    Ratings:
    +2
    Local Time:
    7:04 PM
    1.17.0
    MariaDB 10
    1. are safe removing original .jpg or .png after converted to .webp ?

    2. and how i can fix multiple vary ?
    vary Accept-Encoding ( how to remove this default vary )
    vary Accept

    3. if i using add_header X-Content-Type-Options "nosniff" from server { will apply to all type file css, js, html, etc? or i still need uncomment in /usr/local/nginx/conf/staticfiles-hsts.conf
     
    Last edited: Apr 19, 2020
  6. eva2000

    eva2000 Administrator Staff Member

    44,504
    10,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,734
    Local Time:
    10:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    no you need original image + webp always as not all browsers support webP so if you remove original image, non-webP supported browsers will have broken images

    webP saves image size for clients whose browser supports webP. webP does not save disk space usage for the web site, it increases it as it has to store both original image + webP image which will increase disk usage.

    those are normal Accept and Accept-Encoding are different not the same
    You have to tread what nosniff does and decide for yourself if it's suited to your own web site Security Headers - X-Content-Type: nosniff | Sucuri Docs and you can check which requests get nosniff header by inspecting it in web browser dev tools network tab for header responses or via curl i.e.
    Code (Text):
    curl -I https://yourdomain.com/path/to/image/or/css/jss

    example
    Code (Text):
    curl -I https://www.cloudflare.com
    HTTP/2 200
    date: Sun, 19 Apr 2020 09:21:34 GMT
    content-type: text/html; charset=utf-8
    set-cookie: __cfduid=dedfdfd2735c84edf7a9403822b7880b01587288094; expires=Tue, 19-May-20 09:21:34 GMT; path=/; domain=.www.cloudflare.com; HttpOnly; SameSite=Lax; Secure
    cf-ray: 58658e5d4d508552-ORD
    age: 51
    cache-control: public, s-max-age=30
    strict-transport-security: max-age=31536000
    vary: Accept-Encoding
    cf-cache-status: HIT
    expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    x-content-type-options: nosniff
    x-frame-options: SAMEORIGIN
    x-xss-protection: 1; mode=block
    server: cloudflare
    alt-svc: h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
    cf-request-id: 0233574e4f00008552bb37e200000001
    

    the add_header will apply to whichever context the line is added to within a location{], server{} or specific file extension match location{} context. So answer is it depends on where you use add_header directive as to where it is applied
     
  7. skringjer

    skringjer Member

    139
    15
    18
    Apr 21, 2019
    Ratings:
    +29
    Local Time:
    5:04 PM
    Okay so i followed the guide and everything is working properly. Screenshot

    I wanted to ask why is the original image loaded in JPG or PNG

    Sorry i still haven't properly studied this, i know we need original files for unsupported browsers.

    But in supported browsers it loads all the images originally when i inspect element.
     
  8. eva2000

    eva2000 Administrator Staff Member

    44,504
    10,165
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,734
    Local Time:
    10:04 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    that is normal - image extension is .jpg or .png but mime time is webP when converted