diff --git a/backend/src/main.ts b/backend/src/main.ts
index 7ece1ea..f427162 100644
--- a/backend/src/main.ts
+++ b/backend/src/main.ts
@@ -21,7 +21,9 @@ async function bootstrap() {
const { port, corsOrigins, nodeEnv } = configService.get('app') as Config['app'];
app.useStaticAssets(getPublicUploadsDir(), {
- prefix: publicUploadsUrlPrefix
+ prefix: publicUploadsUrlPrefix,
+ maxAge: '1y',
+ immutable: true
});
const storefrontPublicDir = path.join(__dirname, 'modules', 'storefrontCore', 'public');
diff --git a/backend/src/modules/storefrontCore/public/css/storefront.css b/backend/src/modules/storefrontCore/public/css/storefront.css
index 0e0d750..4bd4286 100644
--- a/backend/src/modules/storefrontCore/public/css/storefront.css
+++ b/backend/src/modules/storefrontCore/public/css/storefront.css
@@ -172,7 +172,6 @@ body.sf-body {
img {
max-width: 100%;
- height: auto;
}
a {
@@ -866,10 +865,14 @@ a:hover {
.sf-product-card__media-link {
display: block;
+ aspect-ratio: 1;
+ background: var(--sf-surface-muted);
+ border-radius: var(--sf-radius-sm);
}
.sf-product-card__image {
width: 100%;
+ height: 100%;
aspect-ratio: 1;
object-fit: cover;
border-radius: var(--sf-radius-sm);
@@ -961,6 +964,7 @@ a:hover {
width: 100%;
height: auto;
aspect-ratio: 1;
+ background: var(--sf-surface-muted);
}
.sf-variant-link--sm {
@@ -1054,6 +1058,7 @@ a:hover {
object-fit: cover;
border-radius: var(--sf-radius);
border: 1px solid var(--sf-border);
+ background: var(--sf-surface-muted);
}
.sf-product-gallery__thumbs {
@@ -1069,6 +1074,7 @@ a:hover {
}
.sf-prose img {
+ height: auto;
border-radius: var(--sf-radius-sm);
}
diff --git a/backend/src/modules/storefrontCore/utils/registerStorefrontPartials.ts b/backend/src/modules/storefrontCore/utils/registerStorefrontPartials.ts
index a2d009d..2c40008 100644
--- a/backend/src/modules/storefrontCore/utils/registerStorefrontPartials.ts
+++ b/backend/src/modules/storefrontCore/utils/registerStorefrontPartials.ts
@@ -27,6 +27,7 @@ const STOREFRONT_PARTIALS = [
{ name: 'shop-head', file: 'shop-head.hbs' },
{ name: 'shop-favicon', file: 'shop-favicon.hbs' },
{ name: 'shop-footer', file: 'shop-footer.hbs' },
+ { name: 'storefront-image', file: 'storefront-image.hbs' },
{ name: 'theme-switcher', file: 'theme-switcher.hbs' },
{ name: 'page-back-link', file: 'page-back-link.hbs' },
{ name: 'product-card', file: 'product-card.hbs' },
diff --git a/backend/src/modules/storefrontCore/views/partials/cart-line-item.hbs b/backend/src/modules/storefrontCore/views/partials/cart-line-item.hbs
index 028955e..fef3000 100644
--- a/backend/src/modules/storefrontCore/views/partials/cart-line-item.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/cart-line-item.hbs
@@ -3,7 +3,13 @@
{{#if thumbnailUrl}}
-
+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}
diff --git a/backend/src/modules/storefrontCore/views/partials/checkout-line-item.hbs b/backend/src/modules/storefrontCore/views/partials/checkout-line-item.hbs
index a8b3673..106ba67 100644
--- a/backend/src/modules/storefrontCore/views/partials/checkout-line-item.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/checkout-line-item.hbs
@@ -4,14 +4,26 @@
{{#if linkHref}}
{{#if thumbnailUrl}}
-
+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}
{{else}}
{{#if thumbnailUrl}}
-

+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}
diff --git a/backend/src/modules/storefrontCore/views/partials/order-line-item.hbs b/backend/src/modules/storefrontCore/views/partials/order-line-item.hbs
index b2adab5..31daf4a 100644
--- a/backend/src/modules/storefrontCore/views/partials/order-line-item.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/order-line-item.hbs
@@ -4,14 +4,26 @@
{{#if linkHref}}
{{#if thumbnailUrl}}
-
+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}
{{else}}
{{#if thumbnailUrl}}
-

+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}
diff --git a/backend/src/modules/storefrontCore/views/partials/product-card.hbs b/backend/src/modules/storefrontCore/views/partials/product-card.hbs
index 4e30cbf..0b45ae6 100644
--- a/backend/src/modules/storefrontCore/views/partials/product-card.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/product-card.hbs
@@ -2,11 +2,14 @@
{{#with selectedVariant}}
{{#if thumbnailUrl}}
-
storefront-image
class='sf-product-card__image'
- src='{{thumbnailUrl}}'
- alt='{{productTitle}} - {{title}}'
- />
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{/if}}
{{/with}}
diff --git a/backend/src/modules/storefrontCore/views/partials/shop-nav.hbs b/backend/src/modules/storefrontCore/views/partials/shop-nav.hbs
index d8f301d..834e1ee 100644
--- a/backend/src/modules/storefrontCore/views/partials/shop-nav.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/shop-nav.hbs
@@ -3,7 +3,13 @@
{{#if logoUrl}}
-
+ {{> storefront-image
+ class='sf-logo'
+ src=logoUrl
+ alt=shopName
+ width='200'
+ height='50'
+ }}
{{else}}
{{shopName}}
diff --git a/backend/src/modules/storefrontCore/views/partials/storefront-image.hbs b/backend/src/modules/storefrontCore/views/partials/storefront-image.hbs
new file mode 100644
index 0000000..7c2a09b
--- /dev/null
+++ b/backend/src/modules/storefrontCore/views/partials/storefront-image.hbs
@@ -0,0 +1,10 @@
+

diff --git a/backend/src/modules/storefrontCore/views/partials/variant-image-gallery.hbs b/backend/src/modules/storefrontCore/views/partials/variant-image-gallery.hbs
index 9b34a38..ac27481 100644
--- a/backend/src/modules/storefrontCore/views/partials/variant-image-gallery.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/variant-image-gallery.hbs
@@ -1,10 +1,13 @@
{{#if selectedImageUrl}}
-
![]()
storefront-image
class='sf-product-gallery__main'
- src='{{selectedImageUrl}}'
- alt='{{productTitle}}'
- />
+ src=selectedImageUrl
+ alt=productTitle
+ width='1'
+ height='1'
+ fetchPriority='high'
+ }}
{{#if galleryImages}}
{{#if (gt galleryImages.length 1)}}
@@ -15,7 +18,13 @@
class='sf-variant-link sf-variant-link--sm{{#if isSelected}} sf-variant-link--selected{{/if}}'
{{#if isSelected}}aria-current='page'{{/if}}
>
-

+ {{> storefront-image
+ src=url
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{/each}}
diff --git a/backend/src/modules/storefrontCore/views/partials/variant-picker-link.hbs b/backend/src/modules/storefrontCore/views/partials/variant-picker-link.hbs
index a9ede6c..77a9e15 100644
--- a/backend/src/modules/storefrontCore/views/partials/variant-picker-link.hbs
+++ b/backend/src/modules/storefrontCore/views/partials/variant-picker-link.hbs
@@ -6,7 +6,13 @@
{{#if size}}style='width:{{size}}px;height:{{size}}px;aspect-ratio:auto;'{{/if}}
>
{{#if thumbnailUrl}}
-

+ {{> storefront-image
+ src=thumbnailUrl
+ alt=''
+ width='1'
+ height='1'
+ loading='lazy'
+ }}
{{else}}
no image
{{/if}}