skip to Main Content

Earlier I have image with dimensions(675*774) and I updated the image with resolution 250*250 but still it’s showing old image.
https://shop.olamsvi.com/pub/media/catalog/category/Picture1_2.png

When I load same Image with ?<random_number> updated image is showing with dimensions (250 * 250)
https://shop.olamsvi.com/pub/media/catalog/category/Picture1_2.png?22

I have deleted my browser cache and also checked in incognito.

Can any one tell what could be the issue.

Sorry for my bad English.

2

Answers


  1. Please, can you see this answer?

    <IfModule mod_expires.c> 
      ExpiresActive On
      ExpiresDefault "access plus 1 seconds"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType image/x-icon "access plus 2592000 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 86400 seconds"
      ExpiresByType application/x-javascript "access plus 86400 seconds"
    </IfModule>
    

    https://stackoverflow.com/a/13029007/4553685

    Maybe it will help you

    Login or Signup to reply.
  2. Apparently there is Varnish caching HTTP reverse proxy in front of your Apache server, which is serving the cached copy of the image (because it was configured to do so).

    You can observe that from HTTP response headers:

     $  curl -v -s https://shop.olamsvi.com/pub/media/catalog/category/Picture1_2.png -o file.png
    *   Trying 52.163.125.20...
    * TCP_NODELAY set
    * Connected to shop.olamsvi.com (52.163.125.20) port 443 (#0)
    ...
    > GET /pub/media/catalog/category/Picture1_2.png HTTP/1.1
    > Host: shop.olamsvi.com
    > User-Agent: curl/7.54.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Date: Mon, 04 Jun 2018 11:52:41 GMT
    < Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips PHP/7.0.21
    < Content-Length: 410771
    < Accept-Ranges: bytes
    < Access-Control-Allow-Origin: *
    < X-Frame-Options: SAMEORIGIN
    < X-Varnish: 41773
    < Age: 0
    < Via: 1.1 varnish (Varnish/5.2)
    < X-Original-Content-Length: 561788
    < Etag: W/"PSA-aj-giNrXrkKdK"
    < Expires: Fri, 22 Mar 2019 05:53:09 GMT
    < Cache-Control: max-age=25120827, public
    < X-Content-Type-Options: nosniff
    < Content-Type: image/png
    <
    { [16384 bytes data]
    * Connection #0 to host shop.olamsvi.com left intact
    

    Not the Via: 1.1 varnish (Varnish/5.2) and Expires: Fri, 22 Mar 2019 05:53:09 GMT lines.
    It is usually very beneficial to cache your static resources, but you should also think about the way how to invalidate it (and when to do it)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search