Jump to content

Search the Community

Showing results for tags 'speed'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News and Announcements
    • News and Announcements
  • osCommerce Online Merchant v2.x
    • General Support
    • osCommerce Online Merchant Community Bootstrap Edition
    • Add-Ons
  • Development
  • General
    • General Discussions
    • Live Shop Reviews
    • Security
    • Developer Feedback
  • PayPal's Announcements
  • Sage Pay's Announcements
  • Solomono - new level osCommerce templates's Announcements
  • German Community's OSCOM v2.x
  • German Community's Allgemein

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Real Name




Found 2 results

  1. This addon minifies the shops css file. If multiple files are selected, it will combine them all into one file. This can reduce the time it takes for the shop to load. Depending upon the size of the css file and how many there are, the page load speed can be reduced by several seconds. It works in any oscommerce shop. For the 2.3.4 shops (both official and Responsive versions), the installation just involves uploading files. For older shops, one change may be needed.
  2. Hi, https://gtmetrix.com/ advises to combine all .css files into one. Then I found that: https://manas.tungare.name/software/css-compression-in-php/ leading me there https://gist.github.com/manastungare/2625128 and then this came out <?php $cssFiles = array( "ext/bootstrap/css/bootstrap.min.css", "custom.css", "user.css" ); /** * Ideally, you wouldn't need to change any code beyond this point. */ $buffer = ""; foreach ($cssFiles as $cssFile) { $buffer .= file_get_contents($cssFile); } // Remove comments $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); // Remove space after colons //$buffer = str_replace(': ', ':', $buffer); // Remove whitespace //$buffer = str_replace(array("\r\n", "\r", "\n", "\t"), '', $buffer); // Collapse adjacent spaces into a single space //$buffer = ereg_replace(" {2,}", ' ',$buffer); $buffer = preg_replace('/[\t\r\n]+/', '', $buffer); $buffer = preg_replace('/[\s]{2,}/', ' ', $buffer); $buffer = str_replace(': ', ':', $buffer); // Remove spaces that might still be left where we know they aren't needed $buffer = str_replace(array('} '), '}', $buffer); $buffer = str_replace(array('{ '), '{', $buffer); $buffer = str_replace(array('; '), ';', $buffer); $buffer = str_replace(array(', '), ',', $buffer); $buffer = str_replace(array(' }'), '}', $buffer); $buffer = str_replace(array(' {'), '{', $buffer); $buffer = str_replace(array(' ;'), ';', $buffer); $buffer = str_replace(array(' ,'), ',', $buffer); // Enable GZip encoding. ob_start("ob_gzhandler"); // Enable caching header('Cache-Control: public'); // Expire in one day header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); // Set the correct MIME type, because Apache won't set it for us header("Content-type: text/css"); // Write everything out echo($buffer); ?> Saved as css_compress.php loaded up to catalog root and included into template_top.php with <link rel="stylesheet" type="text/css" media="screen, print, projection" href="css_compress.php" /> instead of the single css files, only problem is now that glyphicon fonts (which i will get rid of anyway) gives 404. Another question would be how to get css files of addons into that array also. Any thoughts ideas? Best regards Christoph