Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-85411

Only Image files include the timestamp mark which prevents cache products invalidating obsolete files

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.0.X, 7.1.X, Master
    • Fix Version/s: None
    • Component/s: DM > Media Gallery
    • Labels:
      None

      Description

      Steps to Reproduce:

      1. Add a PDF to Documents and Media
      2. Retrieve the download link from the recently added document.
      3. Create a new version of the document.
      4. Retreive the download link from the recently edited document.

       

      Expected Results:

      Generated download URL must be different.

       

      Actual Results:

      Generated download URL are the same.

       

      This makes that cache products like CDN or Reverse Proxy cache the first version without getting notice of new ones.

       

      Basically the question strives in the fact that we're only adding the t parameter to images, but not to other types of documents.

      if (ImageProcessorUtil.isImageSupported(fileVersion)) {
          if (appendVersion) {
              sb.append("&t=");
          }
          else {
              sb.append("?t=");
          }
      
          Date modifiedDate = fileVersion.getModifiedDate();
      
          sb.append(modifiedDate.getTime());
      }
      

      So that if for whatever reason the original document is cached it will stay like that until the cache expires because the generated URL is the same.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sergio.gonzalez Sergio Gonzalez (Inactive)
                Reporter:
                mariano.alvaro Mariano Álvaro
                Participants of an Issue:
                Recent user:
                Ricardo Couso
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 8 weeks, 1 day ago

                  Packages

                  Version Package