CSS

How to Version CSS Files with a Query String to Prevent Cached CSS Use

How to force a browser cache refresh using a CSS query string

Have you ever seen a ‘d’ query string on a CSS link in HTML source code and wondered what it did? The ‘d’ is mostly just a semantic way of describing the parameter that follows it, which is the date. The web server will ignore the string because it isn’t programmed to understand it, but it allows an easy way to cause browsers to think that the CSS file has changed thereby forcing a cache replacement.

<link href="/style.css?d=20101204" rel="stylesheet" type="text/css" />

The only downside is that each time the CSS file is updated, the parameter, which in the above example is a date string, has to be updated. Depending on the software you are using you can use tags to automatically change the date.

How to automatically version the CSS file for cache refresh in WordPress

In WordPress you would use the ‘time’ template tag after the ‘d’ query string like this:

<link href="/style.css?d=" rel="stylesheet" type="text/css" />

Thanks to Stack Overflow for the tip. Some call this the “Expires or Cache-Control Header”.

Be the first to comment - What do you think?  Posted by administrator - December 4, 2010 at 8:00 am

Categories: CSS, HTML, PHP   Tags: ,

Beginning Google Maps API 3


This book is about the next generation of the Google Maps API. It will provide the reader with the skills and knowledge necessary to incorporate Google Maps v3 on web pages in both desktop and mobile browsers.

It also describes how to deal with common problems that most map developers encounter at some point, like performance and usability issues with having too many markers and possible solutions to that.

  • Introduction to the Google Maps API v3
  • Solutions to common problems most developers encounters (too many markers, common JavaScript pitfalls)
  • Best practices using HTML/CSS/JavaScript and Google Maps

What you’ll learn

  • Building reliable Google Maps web applications
  • How to transfer from version 2 to version 3 of the API
  • Best practices using HTML/CSS/JavaScript
  • Dealing with large amounts of map markers
  • How to look up addresses and coordinates using GeoCoding and reversed GeoCoding

Read more…

Be the first to comment - What do you think?  Posted by administrator - August 16, 2010 at 7:33 pm

Categories: CSS, Google Maps, HTML, Javacript   Tags: , ,