WordPress.org

Making WordPress.org

Opened 16 months ago

Closed 15 months ago

Last modified 15 months ago

#3413 closed defect (fixed)

WordCamp Map is cached for 1 week! This means some listings do not show on the map!

Reported by: stiofansisland Owned by: iandunn
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: has-patch commit
Cc:

Description

The map here: https://central.wordcamp.org/schedule does not show all the listings on the map, this is because the map array is cached for 1 week.

I would suggest changing the cache time to at most one day. The queries involved are no that heavy.

https://meta.trac.wordpress.org/browser/sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php?rev=4025#L327

Thanks,

Stiofan

Attachments (2)

map_patch.diff (57.2 KB) - added by stiofansisland 16 months ago.
Patch to change caching to 1 day
3413.diff (723 bytes) - added by stiofansisland 16 months ago.
Revised diff for ticket 3413

Download all attachments as: .zip

Change History (15)

@stiofansisland
16 months ago

Patch to change caching to 1 day

#1 @stiofansisland
16 months ago

  • Keywords has-patch added

#2 @obenland
16 months ago

Yeah, a week seems rather long. @coreymckrill is this something you could look at or provide more history on?

#3 follow-up: @coreymckrill
16 months ago

Looks like @iandunn wrote the original code, I don't know the history. But I agree the cache should expire more quickly.

@stiofansisland somehow your patch is structured to remove all of the contents of the functions.php file and then replace it with the same content, plus your edits. Could you resubmit with just the changed lines?

#4 @obenland
16 months ago

It should be just a matter of replacing WEEK_IN_SECONDS with DAY_IN_SECONDS here.

#5 in reply to: ↑ 3 ; follow-up: @stiofansisland
16 months ago

Replying to coreymckrill:

Looks like @iandunn wrote the original code, I don't know the history. But I agree the cache should expire more quickly.

@stiofansisland somehow your patch is structured to remove all of the contents of the functions.php file and then replace it with the same content, plus your edits. Could you resubmit with just the changed lines?

Sorry, my first time submitting a patch, would love to get it right :(
All i did was:

  1. nano functions.php
  2. svn diff functions.php > functions.php
  3. svn diff > map_patch.diff

Did i miss a step? (i prefer git :) )

Stiofan

#6 in reply to: ↑ 5 @coreymckrill
16 months ago

Replying to stiofansisland:

Sorry, my first time submitting a patch, would love to get it right :(
All i did was:

  1. nano functions.php
  2. svn diff functions.php > functions.php
  3. svn diff > map_patch.diff

Did i miss a step? (i prefer git :) )

Stiofan

No worries. I know the pain of coming to svn from git ;)

I think you actually added an extra step. After you nano functions.php, and the file is changed, you should be able to just do svn diff > 3413.diff

(Note that we prefer that diff files have the ticket number in the name)

In this case you might want to svn revert functions.php first and redo the change. I think your step 2 is what caused the patch weirdness.

@stiofansisland
16 months ago

Revised diff for ticket 3413

#7 @stiofansisland
16 months ago

Second attempt uploaded! :)

#9 @iandunn
16 months ago

  • Keywords commit added
  • Owner set to iandunn
  • Status changed from new to accepted

Hmmm, I don't remember why I chose a full week. It was 2.5 years ago, and the frequency of new camps being approved has grown a lot since then. That's the only thing I can guess.

Lowering it to a day seems good to me.

Side note: If you'd prefer, you can contribute with Git instead.

This ticket was mentioned in Slack in #meta-wordcamp by stiofansisland. View the logs.


16 months ago

#11 @iandunn
15 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 6665:

WordCamp Central: Lower map cache expiration to 1 day.

Props stiofansisland
Fixes #3413

#12 @iandunn
15 months ago

This is deployed now, thanks @stiofansisland :)

#13 @iandunn
15 months ago

In 6666:

WordCamp Central: Restore the About map cache expiration to 1 week.

About 15 seconds after deploying r6665, I remembered why the original expiration was 1 week: because there are multiple maps using this function, and the one on the About page is not visited as often, and doesn't need to be updated as often. It's better to make sure it loads quickly than to make sure it's always up to date.

The map on the Schedule page (and any other maps that are added in the future) will still use a 1 day expiration.

See #3413

Note: See TracTickets for help on using tickets.