Static resource file from skins directory is sometimes found and sometimes returns 404

Hi everyone,

I noted a strange behavior when running our Plone Add-on in a Docker container.

A static resource (JS file) that is located in the skins directory returns on consecutive reloads (w/o browser caching active) sometimes a 404.

For example, when I open the JS file like this:

http://localhost:8080/senaite/senaite_widgets/datetimewidget.js

I see sometimes the JS, and after reload I get a 404. After the next reload it appears again etc.

The funny thing is that it seems to happen only for the files located in the directory senaite_widgets, but not for the ones located in other folders.

There are no other contents/folders with the name senaite_widgets in the portal.

We use Plone 5.3.13 and the contents of the skins.xml looks like this:

<?xml version="1.0"?>
<object name="portal_skins" meta_type="Plone Skins Tool" allow_any="False"
        cookie_persistence="False" default_skin="Plone Default"
        request_varname="plone_skin">

  <!-- senaite images -->
  <object name="senaite_images" meta_type="Filesystem Directory View"
          directory="senaite.core:skins/senaite_images"/>

  <!-- senaite templates -->
  <object name="senaite_templates" meta_type="Filesystem Directory View"
          directory="senaite.core:skins/senaite_templates"/>

  <!-- senaite scripts -->
  <object name="senaite_scripts" meta_type="Filesystem Directory View"
          directory="senaite.core:skins/senaite_scripts"/>

  <skin-path name="*">
    <layer name="senaite_images" insert-after="custom"/>
    <layer name="senaite_templates" insert-after="senaite_images"/>
    <layer name="senaite_scripts" insert-after="senaite_templates"/>
  </skin-path>

</object>

The skins folder is registered in the configure.zcml like this:

  <!-- portal skins -->
  <cmf:registerDirectory
      name="skins"
      directory="skins"
      recursive="True"
      />

I guess that the issue might be related to how the skin and the layers are applied.

E.g. we also have a custom site_icon.png located in the senaite_images skins folder.
When I reload the URL http://localhost:8000/senaite/site_icon.png multiple times, I get one time the Plone icon, and the other time our customized icon.

Any ideas why this could happen?

Thanks and best regards
Ramon