New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DXA does not set cache headers #6
Comments
The |
@bkoopman I see, so the attribute is available but not used. I guess that means that DXA .NET also does not set cache instructions in the response headers. |
In the CXC demo we (Philippe) added caching for the system files since these are versionized anyway and should be cached clientside. .Net version blocks this in Java version there is no cache instruction so some browers do like @jhorsman mentioned
if (urlPath.StartsWith("/system/assets/"))
{
Log.Debug("Setting cache expiration to allow browser caching.");
response.Cache.SetExpires(DateTime.UtcNow.AddDays(10));
response.Cache.SetCacheability(HttpCacheability.Private);
response.Cache.SetMaxAge(TimeSpan.FromDays(10));
} |
Fixed in DXA 1.3 |
…ent-bloom to develop merging history from remote https://bitbucket.org/contentbloom/sdl-dxa-for-java * commit 'f21bc59c90c435ed705b2153be11c2d255b1d6af': (22 commits) changed local config Fixed bug with random ordering of regions Removed ContentResolver code as it's now handled by other classes Removed handleGetPageJSON action from controller - this should no longer be used, as we don't want to leak dd4t json to the client Fix problem with cached requests - dd4t also caches failed broker queries (returning a null value on subsequent calls) Removed ContentProvider.GetPageContent (it leaks the underlying data) Rename EntityModel.PropertyData to XpmPropertyMetadata changed PageData, RegionData & EntityData to XpmMetadata Added RegionModelSet classes to Page Model added logging to file Refactored Page, Region and Entity - renamed to PageModel, RegionModel & EntityModel Renamed TRI taglib to DXA Added default (dummy) implementation of conditionalentityevaluator Added ConditionalEntityEvaluator interface added tridion references to tridion provider pom Renamed richtextprocessor and removed staticcontentprovider class and interface merged staticcontentprovider and contentprovider code, and renamed dd4tcontentprovider to defaultcontentprovider Added JSTL dependency to pom Fixed page title postfix - removed hardcoded space Commit of latest DXA source code ...
DXA JAVA does not set instructions in the cache headers. Result is that Chome and Firefox do cache resources like images, CSS and JavaScript, but IE does not.
The webapp should be more explicit:
An additional improvement of a different order (bonus points for that) would be for DXA to figure out if a page changed and return a 304 if the page and it's content did not change.
The .NET version seems to explicitly disable all caching: https://github.com/sdl/dxa-web-application-dotnet/blob/master/Sdl.Web.Mvc/Controllers/NoCacheAttribute.cs
The text was updated successfully, but these errors were encountered: