// Auto-apply fetchpriority to first N product images const productImages = document.querySelectorAll('.product-img img'); productImages.forEach((img, index) => { if (index < 10) { img.fetchPriority = 'high'; // first 10 images above fold } else { img.fetchPriority = 'low'; // rest are below fold } });