Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    76

    Lightbulb File caching permanently for server - httpd.conf

    Hello,

    i would like to set caching of files like images and other media.

    # 480 weeks
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=290304000, public"
    </FilesMatch>

    this should be added into httpd.conf, but i would like to add it into WHM so changes remain. How can i apply this for particular user account and or entire server please?

    Thank You

  2. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default Re: File caching permanently for server - httpd.conf

    The following section of our EasyApache documentation explains how to add custom entries within <VirtualHost></VirtualHost> containers and have them preserved when cPanel and/or Apache is updated:

    Changes Contained within a VirtualHost Directive

    Also, this page provides an overview of how cPanel and Apache interact, with links to more documentation explaining how to customize Apache and PHP:

    The Apache Web Server and cPanel & WHM
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  3. #3
    Member
    Join Date
    Oct 2010
    Posts
    76

    Default Re: File caching permanently for server - httpd.conf

    Is there any guide how to add my code into WHM? Above manuals too difficult to study.

  4. #4
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default Re: File caching permanently for server - httpd.conf

    No, the modifications must be done via the shell by editing the files mentioned in the documentation to which I referred you.

    Are there any particular sections of our documentation that you find difficult to understand? We welcome any suggestions that we can use to improve our documentation and make it both more informative and easier to read.
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  5. #5
    Member
    Join Date
    Oct 2010
    Posts
    76

    Default Re: File caching permanently for server - httpd.conf

    Your manual is good, but im not a native speaker so its hard for me to get thru all info. I have seen this guide (How to Enable mod_deflate GZIP Compression on CPanel Web Hosts » My Digital Life), and author says:

    Turn On mod_deflate GZIP Compress for Whole Server Globally

    Login to WebHost Manager (WHM), and go to Services Configuration -> Apache Configuration -> Include Editor -> Post VirtualHost Include. Select All Versions for “I wish to edit the Post VirtualHost configuration include file for” option.
    I would like to try it if it will decrease my Server Load. Are the mentioned rules good in your eyes? Is it proper way to edit PHP config on cPanel server?

  6. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: File caching permanently for server - httpd.conf

    If you want this enabled globally for the server, you can indeed try putting it into the Post VirtualHost Include section as indicated. Otherwise, you might try the Pre VirtualHost Include section in WHM > Apache Configuration > Include Editor area.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  7. #7
    Member
    Join Date
    Mar 2011
    Location
    United States
    Posts
    10
    cPanel/Enkompass Access Level

    Website Owner

    Default Re: File caching permanently for server - httpd.conf

    If you're trying to cache files generated through php so that you can save some php/mysql resources, look at php buffer functions, they can be helpful

Similar Threads & Tags
Similar threads

  1. What does httpd.conf,v file suppose to mean?
    By pratapsingh in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-08-2009, 10:37 AM
  2. tweak httpd.conf which include file?
    By kernow in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 05-13-2009, 02:24 PM
  3. Unable to open HTTPD.Conf file.
    By inogenius in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 08-11-2005, 10:07 AM
  4. EDGE_114 broke my httpd.conf file
    By xWho in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 01-08-2005, 10:20 PM
  5. Where is the httpd.conf file?
    By bcw in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 07-17-2004, 07:11 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube