Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

apache - random numbers after a ? on an image is this for far expires headers? -


i pooking around random site on internet , noticed on images have numbers prefixing it: icons-16.png?1292032550

i've heard of people optimising websites far expires headers. if changes content doesn't change often, cache won't refreshed. ergo new image won't re-downloaded someones cache. because filename has change.

yes, intent force refresh of browser cache. however, i not recommend approach:

  • many proxies (and possibly browsers) not cache anything query string, regardless of cache-control headers. you're shooting in foot if include superfluous query string – you'll needlessly consume own bandwidth sending images should cached, aren't.
  • depending on how configure server, user agents periodically make request cached resources, if-modified-since and/or if-none-match header. if client's cache date, server responds 304 not modified , stops; otherwise responds normal 200 ok , sends new content. not have change resource's file name in order client caches updated when resource changes. trying clever query string serves defeat caching mechanisms.
  • that said, if optimize caching setting expires date year out (and if last modified date of resource long ago), user agents may check updates infrequently. if unacceptable you, have 2 options: either reduce amount of time before resource expires (so browser issue get request , can respond 304 or 200 appropriate), or use "url fingerprinting," random token included in path, instead of in query string. example:

    /img/a03f/image.png 

    instead of

    /img/image.png?a03f 

    this way, resources still cached proxies. you'll want in using mod_rewrite allow include token in path. of course, need able change references url whenever change resource.

for further reading, highly recommend google's page speed best practices, section on optimizing caching.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -