Main Content

Magnolia Community Forums: Get help with Magnolia: CSS files are loaded slowly from public after activation


  • chrismenzel
    chrismenzel
    Full name: Christian Menzel
    Posts: 6
    Last post: Feb 17, 2017 3:06:58 PM
    CSS files are loaded slowly from public after activation
    #1 by chrismenzel on Feb 16, 2017 2:31:53 PM

    We have a weird problems with CSS files located in docroot.

    After activation and subsequent flushing of the cache the first access to a page takes over 1 minute. If you cancel the request and reload the page, it is loaded immediately.

    Firebug showed that the loading of the CSS files takes that long.

    I tried the following:

    - access the CSS file directly in a browser after activation -> it takes over 1 minute to load
    - access the CSS file with wget after activation -> it loads immediately

    Does anyone have an explanation for this behavior?

    Thanks
    Chris

  • chrismenzel
    chrismenzel
    Full name: Christian Menzel
    Posts: 6
    Last post: Feb 17, 2017 3:06:58 PM
    Re: CSS files are loaded slowly from public after activation
    #2 by chrismenzel on Feb 16, 2017 7:22:42 PM

    We resolved this by moving the CSS files to the resources folder of a module, but I still don't understand why the files in docroot are behaving differently.

  • cmeier
    cmeier
    Full name: Christoph Meier
    Posts: 190
    Last post: Feb 20, 2017 4:45:30 AM
    Re: CSS files are loaded slowly from public after activation
    #3 by cmeier on Feb 17, 2017 11:22:18 AM

    Hello Chris

    Magnolia 5.4 - which was released on July 3, 2015 - has introduced the concept of "Unified resource loading". Compared to earlier and other approaches it provides a lot flexibility on many aspects.
    Please have a the documentation explaining Resources.

    Before Magnolia 5.4 you had different possibilites or locations to use for webresources such as css files, see https://documentation.magnolia-cms.com/display/DOCS53/Accessing+resources - but docroot never was the 1st choice.
    (Actually, also with Magnolia 5.4 and higher versions you have more then one possibility or location for your webresources, but it is definitely recommended to follow the concept of "Unified resource loading".)

    So, within a Maven module, use the location src/main/resources/<module-name>/
    Within a light module use <magnolia.resources.dir>/<module-name>/

    kind regards,
    Christoph

  • chrismenzel
    chrismenzel
    Full name: Christian Menzel
    Posts: 6
    Last post: Feb 17, 2017 3:06:58 PM
    Re: CSS files are loaded slowly from public after activation
    #4 by chrismenzel on Feb 17, 2017 3:06:58 PM

    Hi Christopher,

    yes, we migrated from a non-maven Magnolia 4.5 project.

    Since serving the files from docroot seemed to work we did not move the files. But now we will keep resources and templates in the /resources folder.

    Thanks
    Chris

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/