Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-2200

Fix the calendar-lang.php file's caching

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.8
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      The calendar-lang.php JavaScript file is not cached, as otherwise the calendar would retain previous language on language changes.

      We should make the file cacheable just like all the other JavaScript files (i.e., with a proper Expires header set into the future), but call it differently based on the current locale - not just request a calendar-lang.php file, but request calendar-lang.php?pl_PL or calendar-lang.php?en_US. This way the browser will re-request the file on locale changes and cache both language versions as separate cache entries on the user's side.

      Note: We can perfectly ignore the parameter on the calendar-lang.php side; we get the locale from the session there, and the parameter is used only to trick the browser to re-request the file.

        Attachments

          Activity

            People

            • Assignee:
              shailesh Shailesh Lende
              Reporter:
              shot Piotr Szotkowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: