Give help. Get help.

  • # January 23, 2013 at 1:26 pm

    I’m a bit behind the ball on this. I have not used far-future Expires headers for cache control.

    Main reason, I’m not sure on best-practices of doing this with the least amount of effort.

    I’ve read [this article]( “this article”), but I’m not sure if this is the easiest way or the best way to do so.

    Anyone have any insight to share?

    # January 23, 2013 at 1:37 pm

    Usually you’d just have one header file that you include on every page, so the easiest way I think would just be to add a query string every time you change the file. The browser will see it as a different file.

    # January 23, 2013 at 3:00 pm

    Servers *should* (and almost always *do*, in my experience) take a query string into consideration when deciding whether to use cached pages.

    # January 23, 2013 at 5:04 pm

    Sorry about that. Had a quick look at the article, saw it was doing all sorts of fancy server-side stuff, and didn’t scroll down all the way.

    I would just change the query string manually. It’s unlikely that you would be liking up the same stylesheet/js file from lots of different files.

    # January 23, 2013 at 7:44 pm

    > So is this the way you guys are going about it? To append to the query string, are you utilizing a PHP function, or manually changing the query string value?

    I usually append `?< ?php echo time(); ?>`. I’ll admit that’s lazy of me, but it works. A better approach is to set the appropriate headers.

    If you’re only “basting the cache” once (e.g., you updated whatever, and you don’t plan on doing so again anytime soon) you might add the query string manually.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.