#7027 Cache /nf/tool_icon_css better

v1.2.0
closed
General
2015-08-20
2014-01-06
No

/nf/tool_icon_css is a dynamically created CSS file. It is currently cached via etag headers, but that means a request still goes to the server and it has to respond with a 304. So this is a lot of extra requests (on sf.net, ~35% of /nf/tool_icon_css requests are 304s)

We should set a future expires header, and then do cache-busting with a unique URL by appending ?{{config.build_key}} (build_key is already used for this purpose for all our other static resources)

Discussion

  • Dave Brondsema

    Dave Brondsema - 2014-01-07
    • Labels: performance --> performance, bitesize
     
  • Dave Brondsema

    Dave Brondsema - 2014-01-28
    • Size: --> 1
     
  • Tim Van Steenburgh

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
    • Size: 1 --> 1
     
  • Tim Van Steenburgh

    • status: in-progress --> code-review

    tv/7027

    allura/lib/utils.py:serve_file() already adds a default expires header, the value just needs to be set in the ini file.

     
  • Tim Van Steenburgh

    • Milestone: forge-backlog --> forge-jul-11
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-10

    Is there some missing code related to the new file_expires_header_secs config? I'm not seeing anything that uses that to set the Expires value header further out.

     
  • Dave Brondsema

    Dave Brondsema - 2014-07-10
    • status: code-review --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-10

    Nevermind, just saw your comment and looking at serve_file() I see the config is called "files_expires_header_secs"

     
  • Dave Brondsema

    Dave Brondsema - 2014-07-10
    • status: in-progress --> closed
    • QA: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2014-07-10

    Updated key name. Also set it to a lower default value since it affects user & project icons, attachments, etc.

     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.