How to enable leverage browser caching for Apache in Plesk

Follow

Comments

14 comments

  • Avatar
    Armin Wucherer

    Hi I have a Ubuntu enviroment and it does not work. 

    If I try the second thing I get already a error: # find / -name mod_expires.so
    find: '/sys/kernel/security/ima': Permission denied
    find: '/sys/kernel/security/apparmor': Permission denied
    find: '/sys/kernel/debug': Permission denied

    nevermind it is in /usr/lib/apache2/modules/mod_expires.so

    #3 would be # vi /etc/apache2/plesk.conf.d/expires.conf

    #4 interestingly there you have the right path

    #5 tried with that string and without

    #6 and #7 no error works fine

    #8 mod_expires does not apear in the list of loaded Apache modules

     

    any idea what I can do next? 

     

    cheers,  Armin 

     

  • Avatar
    Artyom Baranov

    @Stuart de Usoz,

    Hello! You may remove "FileETag None" from Apache config file. As far as I know, 'mod_expires' should not conflict with 'ETag'

  • Avatar
    Armin Wucherer

    just found the solution: move /etc/apache2/plesk.conf.d/expires.conf to /etc/apache2/conf-available/expires.conf and than link it in /etc/apache2/conf-enabled/expires.conf to the available conf file restart apache2 and it works fine

     

  • Avatar
    Vitaly Zhidkov

    @iamkingsleyf, what exact message was shown? You can find it under /var/log/httpd/error_log

  • Avatar
    Vitaly Zhidkov

    @iamkingsleyf, you can enable mod_deflate module from Plesk > Tools & Settings > Apache Web Server

    > also this tutorial did not work as apache failed to start

    Can you share the error message?

  • Avatar
    iamkingsleyf

    Because after adding your code apache failed to start with an error

  • Avatar
    Artyom Baranov

    @1and1 Internet,

    Hello! You should use only the command from step #1:

    # find / -name mod_expires.so

    And `/usr/lib64/httpd/modules/mod_expires.so` is it's output.

  • Avatar
    iamkingsleyf

    its passed now so i can't recall

  • Avatar
    Stuart de Usoz

    Alexander, I'm running Plesk Onyx on Centos, and I followed your instructions and it works fine, thank you. However, I am wondering about "ETag none"  as I'm trying to find best way to always serve image files that have been modified yet cache may still be holding unmodified version.  I just was reading about using ETag and I remembered that I turned it off by following this instruction.   So, will these instructions still work if I remove "ETag none" ?  or do you have suggestion using Apache to always serve modified content?

  • Avatar
    1and1 Internet

    Error on first step "path must precede expression"

     

    See attachment.

  • Avatar
    Ashkan Nasiri

    This KB guide us to enable "Leverage browser caching" on server level. However we want to make it domain level. 

    How can we achieve domain level "Leverage browser caching"?

  • Avatar
    Pavel Rozental

    @Ashkan Nasiri

    I have added this information to the article, check it.

  • Avatar
    Ivan Postnikov

    @Armin Wucherer

    I am glad the solution is found.
    The solution for Ubuntu will be added to this article

Please sign in to leave a comment.

Have more questions? Submit a request