rahulharpal1603 / CF-TopHacker

Chrome extension for displaying Hacks leaderboard on CF.
https://chromewebstore.google.com/detail/cf-tophacker/jjonaiodlgelhegbbihodicniiccbhbi
3 stars 10 forks source link

Adding Cache to reduce server load for heavy contests #2 #7

Closed karimali03 closed 1 month ago

karimali03 commented 1 month ago

Enhancement: Using Cache

Changes Made:

  1. src/Cache.js:

    • A new file was added to implement a caching mechanism.
    • The cache has a timeout of 45 seconds.
    • Created a Cache class to manage the cache.
  2. src/background.js:

    • Imported the Cache class using importScripts.
    • Initialized the cache with CACHE = new Cache().
    • Updated the getHacksStandings function to use the cache.

Screencast from 02 أكت, 2024 EEST 04:06:24 ص.webm

rahulharpal1603 commented 1 month ago

Thanks for the PR! I will run some checks and review this.