Git Product home page Git Product logo

Comments (4)

rpannekoek avatar rpannekoek commented on July 19, 2024

TSI-1943 (internal issue ID for tracking purposes)

from dxa-web-application-dotnet.

rpannekoek avatar rpannekoek commented on July 19, 2024

We have been looking into this Enhancement further (we were considering implementing it in DXA 1.7), but found it to be rather tricky:
Obtaining the Page's last publish date from Broker/DD4T and returning it as Last-Modified header is quite easy, but if the Page Model is dynamically modified (e.g. by XO Model Builder, by CX Dynamic Entity Evaluator or by ListController) or contains DCPs, using the underlying Page's last publish date may not be appropriate.

Closely related to the Last-Modified response header is processing of the If-Modified-Since request header. For this, we have to be especially careful with dynamic Pages: how do we reliably determine whether a rendered Page is modified if it contains dynamic data (which may be obtained from other systems) and even the Views may include dynamic data?

Suggestions how to deal with this?

from dxa-web-application-dotnet.

jsuurd avatar jsuurd commented on July 19, 2024

This functionality would be used (in our case at least) in combination with a deployer extension that flushes the URL on page publish. In this use case using the publish date as Last-Modified header would be perfectly acceptable. Also pages with dynamic content should probably not be cached by the CDN to begin with :).

IMHO I think trying to determine a Last-Modified date depending on when dynamic content on a page changes would be sort of a theoretical discussion and sounds to me like over-engineering the solution. I would compare it to the lastmod time stamp of a page in the sitemap.xml; I don't think anyone generates those real time based on dynamic content on a page.

from dxa-web-application-dotnet.

rpannekoek avatar rpannekoek commented on July 19, 2024

The question is whether it is useful to put a (potentially wrong) Last-Modified response header in, without processing If-Modified-Since request headers?
Typically, the Last-Modified response header is used to trigger a If-Modified-Since header on subsequent requests and the server can then send an HTTP 304 Not Modified response if the page wasn't modified since that date/time.
However, accurately determining whether a (potentially dynamic) Page is modified is not easy.

I agree that "pages with dynamic content should probably not be cached (by the CDN) to begin with". But how do we distinguish between "pages with dynamic content" and "pages with static content"? Isn't the whole idea behind Dynamic Delivery architectures like DXA that the majority of pages have (more or less) dynamic content?

from dxa-web-application-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.