Skip to content

Commit

Permalink
Improve caching of shabbat JSON with date-override
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jul 22, 2024
1 parent 9a02ca2 commit 1d4420c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"eslint": "^9.7.0",
"eslint-plugin-n": "^17.9.0",
"globals": "^15.8.0",
"rollup": "^4.18.1"
"rollup": "^4.19.0"
},
"dependencies": {
"@hebcal/core": "^5.4.11",
Expand Down
2 changes: 2 additions & 0 deletions src/shabbat.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {makeHebcalOptions, processCookieAndQuery, possiblySetCookie,
makeGeoUrlArgs,
shortenUrl,
queryDefaultCandleMins,
CACHE_CONTROL_7DAYS,
localeMap, makeHebrewCalendar} from './common.js';
import {getTodayDate, getDefaultYear, getDefaultHebrewYear,
expiresSaturdayNight} from './dateUtil.js';
Expand Down Expand Up @@ -46,6 +47,7 @@ export async function shabbatApp(ctx) {
}
if (dateOverride) {
ctx.lastModified = new Date();
ctx.set('Cache-Control', CACHE_CONTROL_7DAYS);
} else {
expiresSaturdayNight(ctx, new Date(), options.location.getTzid());
}
Expand Down
3 changes: 2 additions & 1 deletion views/holiday-main-index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<div class="col-sm-8">
<h2>Jewish Holidays <%= yearOverride ? `${hyear - 1}-${hyear + 4}` : '' %></h2>
<% if (hyear <= 5513) { %><%- await include('partials/warning-1752.ejs') %><% } -%>
<p>Dates of major and minor Jewish holidays as observed in <%= il ? 'Israel' : 'the Diaspora' %>.
<p>Dates of major and minor Jewish holidays for years <%=hyear-3762%>-<%=hyear-3756%>,
as observed in <%= il ? 'Israel' : 'the Diaspora' %>.
<span class="d-print-none">
Each holiday page includes a brief overview of special observances and
customs, and any special Torah readings.</span></p>
Expand Down

0 comments on commit 1d4420c

Please sign in to comment.