Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Two time downloading

Avatar

Level 2

When I download an image it's downloading twice. it's been happening recently.

12 Replies

Avatar

Level 4

Can you provide more details, like

  1. Is this happening with any specific image type or env?
  2. Have recently done upgrade?

Avatar

Level 2

If I download any image it will download at the same time twice. 

Avatar

Community Advisor

Hi @HaligulJa 
Please check the click event registered on that link, seems click handler is registered & called twice on click event.

You can simple check this with putting breakpoints in your frontend code or check network calls from browser



Arun Patidar

Avatar

Community Advisor

There could be a few reasons why an image is downloading twice. One possibility is that there is a browser extension or plugin that is causing the issue. You can try disabling any extensions or plugins that you have installed and see if that resolves the issue.

Another possibility is that there is a problem with the website or server where the image is hosted. You can try downloading the image from a different website or server to see if the issue persists.

If neither of these solutions work, you may want to try clearing your browser cache and cookies. This can sometimes resolve issues with downloading files.



Avatar

Level 2

I'm not using the Adblocker extension only in the browser. I paused and tried it again downloading twice. 

Avatar

Community Advisor

@HaligulJa 

Where is this happening? In AEM Assets?

Is the AssetDownloadServlet OSGi component is disabled?

 

If this is happening on Adobe bridge, it is a known issue.

 

 

Avatar

Community Advisor

@HaligulJa This is great! Now we know that this issue is happening on AEM assets, let's try to narrow it down. Are you trying to download it from assets.html or damadmin.

Can you provide the steps from where you are trying to download this image from as there are multiple ways you can download an image?

Avatar

Community Advisor

Hi @HaligulJa ,

Common Causes and Solutions:

  1. Duplicate HTTP Requests:

    • Check Network Activity: Use browser developer tools (F12, then go to the Network tab) to see if there are duplicate requests for the same image.
    • Frontend Code: Ensure that your frontend code (HTML, JavaScript, CSS) is not inadvertently making multiple requests for the same image. This can happen due to event listeners, scripts, or incorrect HTML references.
  2. Image Renditions:

    • Check Renditions: AEM can generate multiple renditions (different sizes and formats) of an image. Ensure your application is requesting the correct rendition.
    • Authoring Configuration: Verify if the image component is configured correctly in AEM. Ensure that it is not configured to render or request multiple renditions unnecessarily.
  3. Client-Side Caching:

    • Cache-Control Headers: Ensure proper caching headers are set for your images. Misconfigured cache settings can cause the browser to re-fetch the image unnecessarily.
    • Browser Cache: Sometimes, browser cache settings can cause unexpected behavior. Clear your browser cache and check if the issue persists.
  4. Proxy or CDN Configuration:

    • Proxy Settings: If you are using a proxy server or a Content Delivery Network (CDN), check its configuration to ensure it’s not causing the duplicate requests.
    • CDN Caching: Verify that your CDN is correctly caching and serving the images. Misconfigured CDN settings might result in duplicate fetches.
  5. AEM Dispatcher:

    • Dispatcher Rules: Check the AEM Dispatcher configuration to ensure it is not causing duplicate requests. Look at the dispatcher.any configuration file and examine the cache rules.
    • Invalidation Rules: Ensure your dispatcher invalidation rules are not leading to multiple requests.
  6. AEM Component Configuration:

    • Component Code: Inspect the AEM component that handles image rendering. Ensure it’s not rendering the image multiple times within the same page.
    • Template Configuration: Ensure the page template and any inherited components are not causing multiple inclusions of the same image.

Detailed Steps to Diagnose:

  1. Using Developer Tools:

    • Open Developer Tools in your browser.
    • Go to the Network tab.
    • Refresh the page and observe the network requests.
    • Identify if there are duplicate requests for the image and note their source.
  2. Review Frontend Code:

    • Inspect the HTML source of your page.
    • Look for multiple img tags or CSS background-image properties that might request the same image.
    • Check JavaScript code for any event listeners or functions that might cause multiple image loads.
  3. Check AEM Authoring and Renditions:

    • In AEM, navigate to the image asset.
    • Check the renditions tab to see if multiple renditions are created and being requested.
    • Ensure the correct rendition is being used in your component.
  4. Review AEM Dispatcher Logs:

    • Access the dispatcher logs.
    • Look for repeated requests for the same image.
    • Verify the cache invalidation and request handling logic.
  5. Check CDN/Proxy Configuration:

    • Review the CDN or proxy configuration for caching rules.
    • Ensure it is not configured to bypass the cache for specific image requests.

Example Troubleshooting Scenario:

If your browser's network tab shows two requests for the same image, the steps might look like this:

  1. Identify Request Source: Note the initiators of the duplicate requests (could be different JavaScript files or HTML elements).
  2. Review HTML: Look for multiple img tags pointing to the same source.
  3. Check JavaScript: Look for any scripts that might trigger additional image loads, such as lazy loading libraries or custom scripts.
  4. Component Review: In AEM, check the image component to ensure it doesn’t have any logic causing it to render the same image twice.
  5. Dispatcher and CDN: Verify that dispatcher and CDN configurations are correct and not causing repeated requests.

By systematically investigating these areas, you should be able to identify and resolve the issue of images downloading twice in AEM.

Avatar

Community Advisor

I would review client-side code like JavaScript and review wether its code from your clientlibs, third-party, or Adobe Launch scripts that may be causing the issues. 

Avatar

Community Advisor

@HaligulJa Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.