Results 1 to 5 of 5

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
    285

    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
    476

    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.

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
  •