fix: bump asset versions to force cache bust; price rate limit own bucket

- app.js and style.css versioned to 20260507a so browsers load new code
- get_shopping_price / get_all_shopping_prices moved to dedicated 'price'
  rate-limit bucket (60 req/min) separate from general (120 req/min)
  to avoid false 429s during sequential per-item price loading
This commit is contained in:
dadaloop82
2026-05-07 17:34:04 +00:00
parent 5f510c0451
commit 3a9f0ccf79
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -115,11 +115,17 @@ function checkRateLimit(string $action): void {
$loginActions = []; $loginActions = [];
$recipeActions = ['generate_recipe', 'generate_recipe_stream']; $recipeActions = ['generate_recipe', 'generate_recipe_stream'];
$errorActions = ['report_error', 'check_update']; $errorActions = ['report_error', 'check_update'];
$priceActions = ['get_shopping_price', 'get_all_shopping_prices'];
if (in_array($action, $aiActions)) { if (in_array($action, $aiActions)) {
$limit = 15; $limit = 15;
$window = 60; $window = 60;
$bucket = 'ai'; $bucket = 'ai';
} elseif (in_array($action, $priceActions)) {
// Price lookups: up to 30 items × a few retries per minute, shared bucket
$limit = 60;
$window = 60;
$bucket = 'price';
} elseif (in_array($action, $recipeActions)) { } elseif (in_array($action, $recipeActions)) {
$limit = 5; $limit = 5;
$window = 60; $window = 60;
+2 -2
View File
@@ -11,7 +11,7 @@
<title>EverShelf</title> <title>EverShelf</title>
<link rel="manifest" href="manifest.json"> <link rel="manifest" href="manifest.json">
<link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png"> <link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png">
<link rel="stylesheet" href="assets/css/style.css?v=20260506e"> <link rel="stylesheet" href="assets/css/style.css?v=20260507a">
<!-- QuaggaJS for barcode scanning --> <!-- QuaggaJS for barcode scanning -->
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
<!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise --> <!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise -->
@@ -1461,6 +1461,6 @@
</div> </div>
</div> </div>
<script src="assets/js/app.js?v=20260505a"></script> <script src="assets/js/app.js?v=20260507a"></script>
</body> </body>
</html> </html>