{"id":206,"date":"2009-07-29T12:15:37","date_gmt":"2009-07-29T12:15:37","guid":{"rendered":"http://divydovy.wordpress.com/?p=66"},"modified":"2020-01-23T10:30:15","modified_gmt":"2020-01-23T10:30:15","slug":"seamless-css-updates","status":"publish","type":"post","link":"https://www.divydovy.com/2009/07/seamless-css-updates/","title":{"rendered":"Seamless CSS Updates"},"content":{"rendered":"<p>If you run a website, sometimes you need to make changes to the (X)HTML/CSS to fix or improve your website&#8217;s styling.</p>\n<p>Sometimes these changes can be pretty drastic in terms of layout changes. Browsers commonly cache CSS files. If a visitor&#8217;s browser has cached the old version of your CSS file, they may see a very ugly version of your site, applying the old stylesheet to the new markup.</p>\n<p>There&#8217;s a cunning way to make sure that visitors always see your site using the latest CSS (I guess this would work with any other cached files e.g. JavaScript too). I ran across it here: <a title=\"Wordpress CSS Cache Buster\" href=\"http://www.alistercameron.com/2008/09/12/wordpress-plugin-css-cache-buster/\">http://www.alistercameron.com/2008/09/12/wordpress-plugin-css-cache-buster/</a> whilst in the world of wordpress.</p>\n<p>The principle is simple. just use a query string on your CSS call &#8211; e.g.</p>\n<pre>&lt;<span>link</span><span> href</span><span>=\"</span><a href=\"http://www.lowcarboneconomy.com/CSS/LCE.css?230709\">/css/your.css?date</a><span>\" </span><span>type</span>=<span>\"text/css\" </span><span>rel</span>=<span>\"stylesheet\" </span><span><span>/</span></span>&gt;</pre>\n<p>Every time you update the CSS file, simply change the query string to that date. This forces any browser to download the new file, which it will cache until the next time you update your query string, or until something else makes the cache expire.</p>\n<p>Cool trick!</p>\n","protected":false},"excerpt":{"rendered":"<p>If you run a website, sometimes you need to make changes to the (X)HTML/CSS to fix or improve your website&#8217;s styling. Sometimes these changes can be pretty drastic in terms of layout changes. Browsers commonly cache CSS files. If a visitor&#8217;s browser has cached the old version of your CSS file, they may see a very ugly version of your site, applying the old stylesheet to the new markup. There&#8217;s a cunning way to make sure that visitors always see your site using the latest CSS (I guess this would work with any other cached files e.g. JavaScript too). I [&hellip;]</p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","clkt_auto_upload":"0","_clkt_publish_and_upload":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wordproof_timestamp":false},"categories":[7],"tags":[31,88,106],"my_content_publications":[],"class_list":["post-206","type-post","status-publish","format-standard","hentry","category-web","tag-css","tag-query-string","tag-update"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"clkt_attachments":{"featured_image":null,"inline_attachments":[],"upload_candidates":[],"max_free_size":102400,"max_allowed_size":104857600},"_clkt_upload_mode":"new_only","clkt_content_hash":"ab5a38a9d2ae2ee056ebcf1e08204bbf965b729f073fee6d765cea4421577af0","customFields":{"clkt_auto_upload":"0","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"processed_attachments":{"total_attachments":0,"uploaded_to_arweave":0,"kept_original_urls":0,"upload_summary":{"total":0,"uploaded":0,"failed":0,"too_large":0,"reused":0}}},"paymentAddress":"8_-tV4d15kVVq9Gd-Al2MAIC3LqNtJ_KgFol71TzxPw"}