Git Product home page Git Product logo

cachekill's People

Contributors

eneko89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cachekill's Issues

Double string on one link

after usage, one image got a wrong replacing.

in the folder the image ist called:
placeholder-valentin-f956d81ec00f7b2e5592ade6fe9f2983.webp

in the html file it was replaced with:
placeholder-valentin-f956d81ec00f7b2e5592ade6fe9f2983-ef63272fee16e03b4c225a575f56864d.webp

Wrong replacements in targets file

Steps to reproduce the bug

Download one page of my website and all its assets with the command

wget -E -k -K -p https://www.mathebibel.de

Open the folder áēww.mathebibel.de and run the command

cachekill -l 16 -r -p '{name}.{hash}{ext}' -s '**/*.{svg,jpg,jpeg,png,ico,ttf,woff,woff2}' -t '**/*.{html,css,js,webmanifest}'

Open the file index.html and search for da5a9c97d2054b2a.

You will get the following 6 hits:

  1. bilder/logo.da5a9c97d2054b2a.png
  2. awards/gpi-logo.da5a9c97d2054b2a.png
  3. awards/stern-logo.da5a9c97d2054b2a.png
  4. awards/ntv-logo.da5a9c97d2054b2a.png
  5. bilder/logo.da5a9c97d2054b2a.png
  6. bilder/easy-tutor-logo.da5a9c97d2054b2a.png

Number 1 and 5 are correct replacements. Number 2, 3, 4 and 6 are wrong replacements.

This was just an example. You can find even more wrong replacements in the index.html.

Only replaces the first reference

First of all thanks for the time you spent in this project. It really fits my needs at the moment:)

When i use the tool and use one reference on two points, it always changes only the first one.
(So when i have 1 picture that i call on two places of the page, the link in the is css only search and replaced by one of them.
So 1 picture still links to the old name)
In the documentation of "replace-in-file" they talk about a regex which is need: https://www.npmjs.com/package/replace-in-file#replace-all-occurrences
Would be in line 129 of your code if i am correct.

Hash in query string shouldn't fingerprint source files

Issue

If the pattern is {name}{ext}?{hash} the source files shouldn't be fingerprinted.

Background information

Appending a query string without changing the file names is a popular cache busting technique.

Implementation

There are several ways to implement this:

  1. If pattern {name}{ext}?{hash} then don't fingerprint source files (don't generate copy/don't allow replacement).
  2. Provide a new option like -S, --Source -> Source file(s) without fingerprinting.
  3. Provide a new option like -Q, --Query which sets the pattern to {name}{ext}?{hash} and doesn't fingerprint source files.

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.