Home  >  Q&A  >  body text

javascript - After adding the max-age cache of static resources, it was found that the same image was loaded multiple times

I configured static resource caching on express

app.use(express.static(path.join(__dirname, 'public'),{maxAge:604800000}));

Found that js or css and other images can be cached normally.
But there is one picture that has been loaded multiple times.
Is it a cache configuration problem?

给我你的怀抱给我你的怀抱2712 days ago451

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-16 13:46:24

    Are the screenshots all the same picture? They are all loaded from memory, indicating that the cache is successful. If it is retrieved multiple times, it should be because the script file has requested the image multiple times.

    reply
    0
  • Cancelreply