Hosting a GWT Webapp in IIS -



Hosting a GWT Webapp in IIS -

i trying configure asp.net web application through web.config, host gwt webapp in specific folder. i've managed configure mimemap .manifest file extension in system.webserver/staticcontent section however, i'm stuck clientcache. want add together caching rule files ".nocache." served next headers:

"expires", "sat, 21 jan 2012 12:12:02 gmt" (today -1); "pragma", "no-cache" "cache-control", "no-cache, no-store, must-revalidate"

anyone knows how within iis 7+ ?

the file time stamp automatically checked in iis , browser requests server updated file based on timestamp, .nocache. files don't need special in iis.

however if wanted browser cache .cache. files next httpmodule sets cache expiration date 30 days files end in .cache.js or .cache.html (or extension). browser won't request updated versions of these files.

using system; using system.collections.generic; using system.linq; using system.web; namespace cachemoduleplayground { public class cachemodule : ihttpmodule { private httpapplication _context; public void init(httpapplication context) { _context = context; context.presendrequestheaders += context_presendrequestheaders; } void context_presendrequestheaders(object sender, eventargs e) { if (_context.response.statuscode == 200 || _context.response.statuscode == 304) { var path = _context.request.path; var dotpos = path.lastindexof('.'); if (dotpos > 5) { var preext = path.substring(dotpos - 6, 7); if (preext == ".cache.") { _context.response.cache.setexpires(datetime.utcnow.add(timespan.fromdays(30))); } } } } public void dispose() { _context = null; } } }

the web.config is:

<configuration> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5" /> </system.web> <system.webserver> <modules> <add name="cacheextension" type="cachemoduleplayground.cachemodule"/> </modules> </system.webserver> </configuration>

iis gwt iis-7 html5-appcache no-cache

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -