Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthias Seghers 3 posts 73 karma points
    May 07, 2019 @ 20:01
    Matthias Seghers
    0

    Cache problems with images

    Hi

    I have problems with my images when they are published for more than 24 hours.

    When I select an image with the media picker and want to show it on the page it works.

    BUT after 24 hours the property returns null...

    The only solution I found to fix it is by "rebuild the database cache" and reload the in-memory and local file cache in the settings section. But I can't do this everyday of course.

    I don't think my code is wrong because everything works after I rebuild the cache. But below you see my code anyway.

    If something is unclear please let me know!

    @foreach (Sport sub in subMenuItems)
      {
         var image = sub.MainPhoto == null ? "https://via.placeholder.com/150x100" : sub.MainPhoto.Url;
         <img src="@image" alt="">
      }
    
  • Bryna 74 posts 260 karma points
    May 08, 2019 @ 18:48
    Bryna
    0

    What version of Umbraco? How often does your application pool recycle?

  • Matthias Seghers 3 posts 73 karma points
    May 08, 2019 @ 18:59
    Matthias Seghers
    0

    It’s umbraco 8.0.1

    When I recycle the application pool nothing changes.

  • Bryna 74 posts 260 karma points
    May 08, 2019 @ 19:07
    Bryna
    0

    If you have a development box that you can set up like your production box, you might see if upgrading to version 8.0.2 fixes it.

    We were having an issue with some files that appeared almost exactly as you described, except we only had to reload the in-memory cache when the application pool recycled. By the time we verified what was happening, someone else had upgraded Umbraco and the problem mysteriously vanished.

Please Sign in or register to post replies

Write your reply to:

Draft