WordPress.org

Ready to get started?Download WordPress

Forums

BulletProof Security
[resolved] Leverage Browser Caching via .htaccess (11 posts)

  1. icing
    Member
    Posted 1 year ago #

    I came across this page, which gives the code to add at the top of the .htaccess to make use of browser caching.

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES CACHING ##

    Where does this code need to go? Custom Code Top?

    What is the best expiration period for my website which basically has mostly static content which is updated only once a month?

    Thanks

    http://wordpress.org/extend/plugins/bulletproof-security/

  2. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, caching .htaccess code should come first before any rewrite .htaccess coding in your root .htaccess file. If you are also using a php/php.ini handler then you will need to also add that code to the Custom Code top box.

    I'm not sure what the best expiration period for your website would be.

  3. icing
    Member
    Posted 1 year ago #

    I am not sure if I am using php/php.ini handler. I am new to wordpress and do not what that is. Pardon my ignorance. Thanks for the reply though.

  4. icing
    Member
    Posted 1 year ago #

    I guess I am not using php handlers. I found this commented out line in .htaccess.

    # ADD A PHP HANDLER
    # If you are using a PHP Handler add your web hosts PHP Handler below
  5. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    A php/php.ini handler is not a WordPress thing. If your particular web host allows you to use php/php.ini handlers then handlers will allow you to control what version of php is loaded and other things like loading CGI or FastCGI and adding a custom php.ini file for your website.

  6. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

    @adityabajaj - please see the forum guidelines re: helping out here and posting links to your site:

    http://codex.wordpress.org/Forum_Welcome#Helping_Out

  7. adityabajaj
    Member
    Posted 10 months ago #

    @WPyogi thanks for reminding about the guidelines. In this case, how should i direct solution seekers to the information?

  8. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

    Mostly, you should answer their questions here. IF it's a current thread that has not been answered and a link to an outside resource is particularly relevant, it's generally okay to post that. But when you've posted the same link in multiple OLD (some already resolved) threads, that's pretty much outside what is considered okay.

  9. adityabajaj
    Member
    Posted 10 months ago #

    oh i see! I got you. However, before I had this information handy I had landed up on that old thread. So wanted to help users who land up on the old thread like i did. But I understand of what you mean here and will take care of it.

  10. icing
    Member
    Posted 10 months ago #

    @adityabajaj if you have any information on this regards. Please post. I am always open to learning new things and making improvements. If possible just copy-paste the relevant information.

    I request moderator to let him post a link if he wishes to. After going through his link I will write a review here about it.

  11. AITpro
    Member
    Plugin Author

    Posted 10 months ago #

    @icing - WordPress Forum Guidelines need to be followed so asking a Mod to make an exception for something that does not follow the WordPress Forum Guidelines in one case only leads to making exceptions in other cases. WordPress has Forum rules/guidelines in place for a reason. I have posting rules on all of my sites. If the rules are not followed then I do the exact same thing - let the person know what is not allowed and correct it. ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic