Results 1 to 7 of 7

Thread: How to minify css and make combined js file async

  1. #1
    New user
    Join Date
    09-13-17.
    Posts
    26

    Ausrufezeichen How to minify css and make combined js file async

    Hi I need to optimise the site . So I want
    1. minify css
    2. make combined js file async


    I selected all the external css in Themes-> Layout -> my Layout and enabled Combine scripts. Then enabled Minify the markup and
    Compress scripts in System->Settings . But the css file is not minified.What will be the reason ?

    And also I need to know how to set async to combined js file

  2. #2
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    Contao has no support for minifiying CSS out of the box - unless you use server side SCSS processing (in that case I think the resulting CSS is minified).

  3. #3
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Minify the markup is only for HTML code as explained in the help text below.
    You should not activate Compress scripts as this is only for bad servers which are not able to send data gziped and requires a change in the htaccess also.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  4. #4
    New user
    Join Date
    09-13-17.
    Posts
    26

    Default

    Quote Originally Posted by Andreas View Post
    Minify the markup is only for HTML code as explained in the help text below.
    You should not activate Compress scripts as this is only for bad servers which are not able to send data gziped and requires a change in the htaccess also.

    then,what is the correct method to minify css and avoid render blocking in contao ?

  5. #5

    Default

    depending on how your server is set up you could use some server side minify process.

    Check github here for some info on how to do it with an nginx based setup.

    https://stackoverflow.com/questions/...de-auto-minify

    However, it may be a better idea to minify your css prior to uploading it to your server, generally speaking it would reduce the server load and give you a better page performance.

  6. #6
    User
    Join Date
    05-21-18.
    Posts
    126

    Default

    Quote Originally Posted by aswathy View Post
    Hi I need to optimise the site . So I want
    1. minify css
    2. make combined js file async


    I selected all the external css in Themes-> Layout -> my Layout and enabled Combine scripts. Then enabled Minify the markup and
    Compress scripts in System->Settings . But the css file is not minified.What will be the reason ?

    And also I need to know how to set async to combined js file
    Best way to compress js is to use COMBINER. Search code for that

  7. #7
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    AFAIK the combiner only puts multiple files into one file eventually minifies but does not compress.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •