{"id":2351,"date":"2012-02-02T16:06:22","date_gmt":"2012-02-02T16:06:22","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2012\/02\/02\/318-using-web-browser-caching-in-opencart\/"},"modified":"2021-03-15T16:38:39","modified_gmt":"2021-03-15T20:38:39","slug":"using-web-browser-caching-in-opencart","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/","title":{"rendered":"Using Web Browser Caching in OpenCart 1.5"},"content":{"rendered":"\n<p>Basically, all the files your site uses (<em>jpgs, gifs, css, js, etc<\/em>) need to be able to tell visitors computer how long they should keep them for before checking for a new file. This is called web browser caching.&nbsp;If we don&#8217;t specify the browser a &#8220;<strong>cache time<\/strong>&#8221; then it will get a new copy of the file every time they visit the site which means more bandwidth usage and increases your page load speeds.<\/p>\n\n\n\n<p>Google Page Speed recommends that files are cached at least a month. If you don&#8217;t make many changes, set it to at least a month. However, if you make changes to your site or are still working on developing the site, you may want to set your JS and CSS files to something lower such as 24 hours. However, in the example below we have set the caching of all files to 5 weeks.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Turn on Expires and set default to 0\nExpiresActive On\nExpiresDefault A0\n\n# Set up caching on media files for 5 weeks\n&lt;FilesMatch \"\\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$\"&gt;\nExpiresDefault A3024000\nHeader append Cache-Control \"public\"\n&lt;\/FilesMatch&gt;\n\n# Set up caching on media files for 5 weeks\n&lt;FilesMatch \"\\.(gif|jpg|jpeg|png|swf)$\"&gt;\nExpiresDefault A3024000\nHeader append Cache-Control \"public\"\n&lt;\/FilesMatch&gt;\n\n# Set up 5 week caching on commonly updated files\n&lt;FilesMatch \"\\.(xml|txt|html|js|css)$\"&gt;\nExpiresDefault A3024000\nHeader append Cache-Control \"proxy-revalidate\"\n&lt;\/FilesMatch&gt;\n\n# Force no caching for dynamic files\n&lt;FilesMatch \"\\.(php|cgi|pl|htm)$\"&gt;\nExpiresActive Off\nHeader set Cache-Control \"private, no-cache, no-store, proxy-revalidate, no-transform\"\nHeader set Pragma \"no-cache\"\n&lt;\/FilesMatch&gt;<\/code><\/pre>\n\n\n\n<p>To leverage web caching you will have to add some lines of code to your .htaccess file in the root folder of your OpenCart installation.<\/p>\n\n\n\n<p>If you need further assistance please feel free to <a href=\"\/support\/questions\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\"  >ask a question on our support center<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Basically, all the files your site uses (jpgs, gifs, css, js, etc) need to be able to tell visitors computer how long they should keep them for before checking for a new file. This is called web browser caching.&nbsp;If we don&#8217;t specify the browser a &#8220;cache time&#8221; then it will get a new copy of<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\"> Read More ><\/a><\/p>\n","protected":false},"author":56983,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[81],"tags":[],"class_list":["post-2351","post","type-post","status-publish","format-standard","hentry","category-opencart"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-02T16:06:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-15T20:38:39+00:00\" \/>\n<meta name=\"author\" content=\"Carrie Smaha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@carriesmaha\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carrie Smaha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\"},\"author\":{\"name\":\"Carrie Smaha\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\"},\"headline\":\"Using Web Browser Caching in OpenCart 1.5\",\"datePublished\":\"2012-02-02T16:06:22+00:00\",\"dateModified\":\"2021-03-15T20:38:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\"},\"wordCount\":197,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"OpenCart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\",\"name\":\"Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2012-02-02T16:06:22+00:00\",\"dateModified\":\"2021-03-15T20:38:39+00:00\",\"description\":\"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Web Browser Caching in OpenCart 1.5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8\",\"name\":\"Carrie Smaha\",\"description\":\"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/carriesmaha\/\",\"https:\/\/x.com\/carriesmaha\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting","description":"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/","og_locale":"en_US","og_type":"article","og_title":"Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting","og_description":"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2012-02-02T16:06:22+00:00","article_modified_time":"2021-03-15T20:38:39+00:00","author":"Carrie Smaha","twitter_card":"summary_large_image","twitter_creator":"@carriesmaha","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Carrie Smaha","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/"},"author":{"name":"Carrie Smaha","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8"},"headline":"Using Web Browser Caching in OpenCart 1.5","datePublished":"2012-02-02T16:06:22+00:00","dateModified":"2021-03-15T20:38:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/"},"wordCount":197,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["OpenCart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/","name":"Using Web Browser Caching in OpenCart 1.5 | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2012-02-02T16:06:22+00:00","dateModified":"2021-03-15T20:38:39+00:00","description":"In this article we will explain why it is important to use web browser caching and what code to add to your .htaccess file to utilize it on your OpenCart website.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/using-web-browser-caching-in-opencart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Using Web Browser Caching in OpenCart 1.5"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/595948dab2995d347a87076abdae19d8","name":"Carrie Smaha","description":"Carrie Smaha is a Senior Marketing Operations leader with over 20 years of experience in digital strategy, web development, and IT project management. She specializes in go-to-market programs and SaaS solutions for WordPress and VPS Hosting, working closely with technical teams and customers to deliver high-performance, scalable platforms. At InMotion Hosting, she drives product marketing initiatives that blend strategic insight with technical depth.","sameAs":["https:\/\/www.linkedin.com\/in\/carriesmaha\/","https:\/\/x.com\/carriesmaha"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/carries\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":81,"name":"OpenCart","slug":"opencart","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/opencart\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/56983"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2351"}],"version-history":[{"count":4,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2351\/revisions"}],"predecessor-version":[{"id":70188,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2351\/revisions\/70188"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}