Copied to clipboard

Flag this post as spam?

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


  • David Redmond 24 posts 76 karma points
    Jan 05, 2019 @ 02:04
    David Redmond
    0

    Static content no longer being served

    Hi All,

    I've been working on an Umbraco site (7.12.4 with VS2017) and before Christmas all was fine. I've opened it up again to continue working and suddenly all of the static content is no longer being displayed.

    This includes folders such as;

    • /Assets/
    • /Scripts/
    • /App_Plugins/

    The first 2 are listed in umbracoReservedPaths and I've never had to add the 3rd before. I'm getting errors attempting in the backend with megaNav not finding it's editor files in that path.

    I've reinstalled the nuget package, compared Web.config against other working sites on the same development PC (within the same solution) and nothing obvious stands out.

    • umbracoReservedPaths lists the folders I have excluded
    • runAllManagedModulesForAllRequests is set to true
    • StaticFileHandler module is loaded

    If I load an image with a query string, then it is loading but that doesn't help with all the javascript & CSS files. Here are some curl outputs;

    *   Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 27130 (#0)
    > GET /Assets/images/logo-dark.png HTTP/1.1
    > Host: localhost:27130
    > User-Agent: curl/7.47.0
    > Accept: */*
    >
    < HTTP/1.1 404 Not Found
    
    
    *   Trying 127.0.0.1...
    * Connected to localhost (127.0.0.1) port 27130 (#0)
    > GET /Assets/images/logo-dark.png?width=50 HTTP/1.1
    > Host: localhost:27130
    > User-Agent: curl/7.47.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    

    If I place the image in the root folder, it is retrieved without issue.

    The issue is directly accessing any sub folders just stopped working and I've run out of options in attempting to fixing it. I'd be grateful if anyone had any suggestions.

    Cheers!

  • David Redmond 24 posts 76 karma points
    Jan 06, 2019 @ 05:00
    David Redmond
    0

    I've found a work around by adding this into the Web.config for each of the paths I want excluded in umbracoReservedPaths, this is the first time I've had to do it in any project.

      <location path="assets">
        <system.webServer>
          <handlers>
            <remove name="StaticFileHandler" />
            <add name="StaticFileHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.StaticFileHandler" />
          </handlers>
        </system.webServer>
      </location>
    
  • Marc Deschenes 5 posts 76 karma points
    Jun 24, 2020 @ 20:04
    Marc Deschenes
    0

    David, thank you for this. We're running up against IIS Memory limits in 32-bit mode.

    But upon changing to 64-bit mode, static assets stop working. The application seems to work per usual, as I've tested various API's and other controller functionality.

    Not 100% sure why this is, but your solution seems to work. I've added a handler for every location, including umbraco,umbracoclient, appplugins, etc.

    Out of curiosity, were you able to determine why the StaticFileHandler stops working all together when changing to 64-bit? Have you noticed any other unwanted side effects?

    All the best, and thanks again for posting your solution. -Marc

  • David Redmond 24 posts 76 karma points
    Jun 24, 2020 @ 22:25
    David Redmond
    0

    Hi Marc, glad to share the solution and get your site going.

    I still don't know why it happened with a perfectly good working site. I kept investigating but could not find any solution. The site has been running perfectly fine since the change and no side effects have been noticed.

    Cheers!

  • Marc Deschenes 5 posts 76 karma points
    Jun 24, 2020 @ 23:14
    Marc Deschenes
    0

    Fantastic, appreciate you providing that update.

    It's quite elusive. For what it's worth, our application pool in question has always been at 32-Bit for many years. With recent increase in usage, we're finding memory consumption is starting to cap out on this pool. This is especially noticeable when cropping images in Umbraco (e.g out of memory exceptions).

    For that reason, I wanted to move to a 64 bit pool for more addressable memory. That's when the static file module stopped working. Could be IIS Role related, not sure if architectures are treated differently.

    Either way, I prefer your solution to recycling the pool all the time :) Thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft