goldhand / goldhand/sw-precache-webpack-plugin

Keeps caching same resources?

Open
#160 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.4k
Forks
101
PR merge metrics
No merged PRs in 30d

Description

## **BEFORE YOU SUBMIT** please read the following:

* [x] **I'm submitting a bug report**
* [ ] **I'm submitting a feature request**
* [ ] **I'm submitting a support request**

**webpack version:**
4.20.2

**sw-precache-webpack-plugin version**:
0.11.5

**Please tell us about your environment:**
Windows 10

**Browser:** Chrome 70

**Current behavior:**
When reloading the same page over and over it keeps adding to the cache with more then a few MB's. So after a user visits about 10 pages it's over 200MB. Is it normal that it keeps caching the same assets?

![caching](https://user-images.githubusercontent.com/17417414/48351611-f714a200-e68a-11e8-8693-40111de8b3ea.gif)

**Expected/desired behavior:**
Don't re-cache assets for a second time.

*If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with your:*

* **Webpack configuration:**
```
new SWPrecacheWebpackPlugin({
filepath: path.resolve("./static/service-worker.js"),
staticFileGlobs: ["static/**/*"],
minify: true,
staticFileGlobsIgnorePatterns: [/\.next\//],
runtimeCaching: [
{
handler: "fastest",
urlPattern: /[.](png|jpg|css)/
},
{
handler: "networkFirst",
urlPattern: /^https?.*/
}
]
})
```

* **Generated service worker (not minified):**
[Gist of this](https://gist.github.com/nealoke/a53736969d6e07b273d7ad33cfff7338)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.