MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
What determines a "static asset"
Current time: 08-15-2020, 04:03 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What determines a "static asset"
01-28-2011, 12:22 AM
Post: #1
What determines a "static asset"
I have a site that uses several Ajax calls to acquire (JSON) data that is used by client-side Javascript to render the page. I am working to have my server-side scripts return better headers to optimize performance. In my test results, under Speed Optimization, I get a report to "Remove query string from static resources." The resources referenced are for CGI scripts that return data.

Further, WPT advices that these "static resources" should be served from a cookieless domain. While I do use a distinct domain for true static resources (CNAMEd to my CDN), these scripts need information from the client in order to properly assemble the returned JSON payload. The data is transmitted to the scripts by both cookies and query string arguments.

So, I am curious how WPT determines what is a "static resource" ?

Here are the Headers returned for one of these Ajax calls:

Cache-Control:public, max-age=86400
Connection:Keep-Alive
Content-Encoding:gzip
Content-Type:application/json; charset=utf-8
Date:Thu, 27 Jan 2011 12:46:05 GMT
Keep-Alive:timeout=2, max=194
Last-Modification:Wed, 25 Aug 2010 14:15:20 GMT
Server:Apache
Transfer-Encoding:Identity
Vary:Accept-Encoding


Notes:

1) my script examines the request header for Accept-Encoding, and returns gzip'd content when possible (which is the case in the Headers above)

2) the script is returning content derived from a file. I never know when that data will change, and presently it has not changed in a while (the Last-Modification header is the date of the last change to the file). But since it *may* change, I set the cache max-age to 1 day.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
What determines a "static asset" - Zhami - 01-28-2011 12:22 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)