Quantcast
Channel: Recent Questions - Craft CMS Stack Exchange
Viewing all articles
Browse latest Browse all 222

Image Transformation causes error 503

$
0
0

I have too many images on a overview page, and it kills the server which creates a error 503.

  • I converted all source images to less than 1MB, but it still crashes the server. (Using Imager X on craft 4).
  • It was working under craft 3 but craft 4 seems to be not as resourceful, idk and yeah my code isn't great.
  • php execution time is 300 seconds
  1. Is there a way to see at which image the server goes down?

  2. Is there any way to write the image macro causing this more efficiently?

    {% macro portfolioListing(handleParam, ratioRaram) %}{% set image = handleParam %}{% import _self as macro %}{% if handleParam | length %}    {% if handleParam.extension == 'svg' %}        {{ svg(image) }}    {% else %}    {% set transformedImages = craft.imager.transformImage(image,             [{ width: 170 }, { width: 980 },{ width: 1065 }],            { jpegQuality: 75, ratio: ratioRaram, allowUpscale: false },            { filenamePattern: macro.imageNaming(image) | kebab ~ '-' ~ '_{fullname|shorthash}.{extension}' })         %}<img            data-sizes="auto"            src="{{ craft.imager.placeholder() }}"            data-srcset="{{ craft.imager.srcset(transformedImages) }}"            alt="{{ macro.imageNaming(image) }}"            class="lazyload{{ image.dropShadow ? ' dropShadow' : '' }}"            data-majorImg="{{transformedImages[3].url}}"        />    {% endif %}{% endif %}{% endmacro %}

Not sure how to go about this right now.


Viewing all articles
Browse latest Browse all 222

Latest Images

Trending Articles





Latest Images