Giter VIP home page Giter VIP logo

Comments (3)

P-T-I avatar P-T-I commented on August 23, 2024 1

This would be a nice addition! Regarding saving the header to file; we could save it to the info collection of the database as well; saves that hassle of dealing with files.

from cvexplore.

oh2fih avatar oh2fih commented on August 23, 2024

I was thinking of a rather simple solution, if you don't find it too quick and dirty:

  • Use a JSON based header cache saved as a file in working directory.
  • Skip download if both Last-Modified and Content-Length headers are the same. No need for actually comparing the values even.
  • If anything goes wrong, log the warnings/error and return True for "the file probably has changes" & let the current logic try the downloads and catch any errors. The same approach can cover both internal errors with the cache file loads, writes & contents as well as external errors with the HTTP communications.
  • Only enable this check on certain data sources (CPE, CAPEC, VIA4) and keep the current functionality for EPSS.

Note to self:

  • The repopulation probably needs to either delete or empty this file.

from cvexplore.

oh2fih avatar oh2fih commented on August 23, 2024

Thanks for the hint. Because the info collection already had this information cached we didn't even need additional caches, but could simply compare the value in there. That made adding the new functionality rather straightforward. Please review the pull request.

After this I can simply lower the update interval on CVE-Searche's SystemD timer from 2 hours to 1 hour, which would also be the same as the sleep time in the db_updater.py -v -l (loop mode). 👍

from cvexplore.

Related Issues (20)

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.