WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years 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 2 years ago.
Patch to change caching to 1 day
3413.diff (723 bytes) - added by stiofansisland 2 years ago.
Revised diff for ticket 3413

Download all attachments as: .zip

Change History (15)

@stiofansisland
2 years ago

Patch to change caching to 1 day

#1 @stiofansisland
2 years ago

  • Keywords has-patch added

#2 @obenland
2 years ago

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

#3 follow-up: @coreymckrill
2 years 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
2 years 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
2 years 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
2 years 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
2 years ago

Revised diff for ticket 3413

#7 @stiofansisland
2 years ago

Second attempt uploaded! :)

#8 @coreymckrill
2 years ago

Perfect!

#9 @iandunn
2 years 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.


2 years ago

#11 @iandunn
2 years 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
2 years ago

This is deployed now, thanks @stiofansisland :)

#13 @iandunn
2 years 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.