'Expires' and 'Cache-Control' cache headers
  • My site that is hosted on Vae uses bespoke @font-face included type faces (yes they're licensed). To work cross platform the fonts are stored in various file formats (.eot, .svg, .ttf, .woff).

    The fonts are rather heavy and I'd like to control cache headers to ensure the browser does not re-request them.

    It seems 'Last-Modified' is set to that of the timestamp of the file, which is nice since it provokes If-Modified-Since behaviour. 'Cache-Control' is set to max-age=0, which works for this.

    However I want to make it even better, stopping the browser from asking altogether using future 'Expires' and 'Cache-Control'.

    If these were .html or .php files I assume I could use the global php include to modify headers, but my file endings are not processed (according to docs).

    Is it possible to do what I want?

  • 1 Answer sorted by
  • Hey there,

    We automatically set these headers if you access the assets via our CDN domain, ____.vaesite.net. (note the .net). In your code, you can use <v:asset src="my.css" /> instead of a simple <link> tag and we will automatically rewrite your code to pull from the appropriate CDN URL, which will automatically have the effect of setting those headers on your files.

    For more info, see http://docs.vaeplatform.com/v_asset

    Alternatively, you can always get a CDN URL yourself by doing <v:cdn src="myfile.css" />.

    Does that help?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion