Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 659103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:00:27+00:00 2026-05-13T23:00:27+00:00

I have a site in multiple languages. I have a method that returns me

  • 0

I have a site in multiple languages. I have a method that returns me the today currencies in a array. I display that currencies in a table then.

// --- en/index.php
<?php
include_once "../exchangeRates.php";
$currencies = ReadExchangeRates();

// --- fr/index.php
<?php
include_once "../exchangeRates.php";
$currencies = ReadExchangeRates();

...
// somewhere in the page
<td><?php echo $currencies["eur"]["today"]; ?></td>

So, every time I load, en/ or fr/ or other language, I request the exchange rates from a external site.

Can I optimize this behavior (reading once per day or session)?

maybe to store a global variable and check the update date?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:00:27+00:00Added an answer on May 13, 2026 at 11:00 pm

    All variables die with the script, global or local, they can’t be used for cache purposes.

    You have several solutions depending on your resources:

    • You can pick the exchange rates, serialize them as a string and store it into a file. When you you need to print them, read the file modification time; if it’s older than X, fetch fresh data from the external server, otherwise unserialize your current data and display it.

    • And, of course, you can simply store raw data in a proper SQL database and update it in regular basis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site with multiple pages, and each page has a table that
I have a site that has all its content translated to multiple languages and
I am building a multi language site I have a descriptions table that hold
Below is my table, a User could have multiple profiles in certain languages, non-English
I have created a site with multiple languages in sitecore... I the content editor
Alright im doing a site which is available in multiple languages. I have ran
Let's say I have a site with multiple links as follows: www.example.com/product/1 www.example.com/product/2 www.example.com/product/3
I have multiple Projects(site) in my Solution (visual studio 2010). when i run my
I have a problem with my site. The site has multiple entities: Articles, Posts,
I have a web site (ASP.NET, no MVC) with multiple web forms for filling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.