Skip to main content

Reduce Page Speed

Enable gzip compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE image/png image/gif image/jpeg image/jpg text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript application/json
</IfModule>

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff
AddType font/svg .svg

Leverage Browsing Cache
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 10 days"
    ExpiresByType image/png "access plus 10 days"
    ExpiresByType image/gif "access plus 10 days"
    ExpiresByType image/jpeg "access plus 10 days"
    ExpiresByType image/jpg "access plus 10 days"
    ExpiresByType text/css "access plus 10 days"
    ExpiresByType application/javascript "access plus 10 days"
    ExpiresByType application/x-javascript "access plus 10 days"
    ExpiresByType text/javascript "access plus 10 days"
    ExpiresByType application/x-shockwave-flash "access plus 10 days"
</IfModule>
##Header Expires end
Cache Control Headers
##cache-control headers
<IfModule mod_headers.c>
    <FilesMatch "\.(ico|jpeg|png|gif|swf|jpg|html|phtml|woff)$">
        Header set Cache-Control "Pragma=Cache, max-age=864000, public"
        SetOutputFilter DEFLATE
    </FilesMatch>

    <FilesMatch "\.(js|css)$">
        Header set Cache-Control "Pragma=Cache, max-age=864000, public"
        SetOutputFilter DEFLATE
    </FilesMatch>
    Header set Cache-Control "Pragma=Cache, max-age=864000, public"
        SetOutputFilter DEFLATE
</IfModule>
##cache-control ends

Comments

Popular posts from this blog

PHP DATABASE CONNECTION

//connecting to db $conn = mysql_connect("localhost","peter","abc123"); if (!$conn) { die('Could not connect: ' . mysql_error()); } // some code mysql_close($conn); // closing connection //query db $data=$conn->query("SELECT * FROM myTable "); foreach($data as $row) { print_r($row); }

CUSTOM WHERE CLASS IN SUGARCRM DASHLETS

How to add custom where class in sugar dashlets??? for example if you want to see top opportunities dashlet containing only filtered opportunities on some condition then you can do this as below require_once(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.php’); class MyOpportunitiesCustomDashlet extends MyOpportunitiesDashlet { function MyOpportunitiesCustomDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; require(‘modules/Opportunities/Dashlets/MyOpportunitiesDashlet/MyOpportunitiesDashlet.data.php’); parent::MyOpportunitiesDashlet($id, $def); } function process($lvsParams = array()) { $lvsParams = array( ‘custom_select’ => ”, ‘custom_from’ => ”, ‘custom_where’ => ‘ AND opportunities.sales_stage=\’Qualification\”, ‘distinct’ => true ); parent::process($lvsParams); } } these codes are only hints, you should know where these piece of codes should be placed to be working..

AJAX BANNED MODULES

In SugarCRM if you want to ban ajax only for particular modules then go to your config_override.php file and add this code $sugar_config['addAjaxBannedModules'][] = “KReports”; //disable ajaxgui for specific module in config override. Now you have done