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:
@@ -115,11 +115,17 @@ function checkRateLimit(string $action): void {
|
||||
$loginActions = [];
|
||||
$recipeActions = ['generate_recipe', 'generate_recipe_stream'];
|
||||
$errorActions = ['report_error', 'check_update'];
|
||||
$priceActions = ['get_shopping_price', 'get_all_shopping_prices'];
|
||||
|
||||
if (in_array($action, $aiActions)) {
|
||||
$limit = 15;
|
||||
$window = 60;
|
||||
$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)) {
|
||||
$limit = 5;
|
||||
$window = 60;
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
<title>EverShelf</title>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<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 -->
|
||||
<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 -->
|
||||
@@ -1461,6 +1461,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="assets/js/app.js?v=20260505a"></script>
|
||||
<script src="assets/js/app.js?v=20260507a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user