Posts

Showing posts from May, 2016

Adding cache-control on static assets | Improve data integrity and performance

Adding cache-control on static assets | Improve data integrity and performance Static files (example: JS\CSS\HTML.) are cached by client browsers and if they don't carry cache-control directive in the HTTP-header, it is up to the browsers to determine, how often to check to check for updated value from server. Some times browsers could cache stale content for days. This could cause the static file to be obsolete and pick from local browser cache and out of sync and could potentially result in broken pages and corrupt files. The solution is to add cache-control directive to the web server configuration and this will force the browser to check for the updated version from the server when the time specified expires. The functionality would essentially result in HTTP_STATUS code 200 when a file is modified and other wise would return HTTP_STATUS code 304 Testing the HTTP-Header changes: You can using tamper data as Firefox plugin or fiddler for IE to look at the HTTP-header Ma

WCS Dojo Refresh Area (AJAX Request using DOJO)

1.  Create a refreshable div of dojo <div dojoType="wc.widget.RefreshArea" id="MiniShoppingCart" widgetId="MiniShoppingCart" controllerId="MiniShoppingCartController" onmouseover="showMiniShopCartDropDown('placeHolder','quick_cart_container','orderItemsList');" role="wairole:region" waistate:live="polite" waistate:atomic="true" waistate:relevant="all"> <%out.flush();%> <c:import url="${jspStoreDir}include/MiniShopCartDisplay.jsp">  <%-- variables come from HeaderDisplay.jspf --%>   <c:param name="storeId" value="${param.storeId}"/> <c:param name="catalogId" value="${param.catalogId}"/> <c:param name="langId" value="${param.langId}"/> </c:import> <%out.flush();%> </div>